XSLT with NameSpace prefixes - Not Bound issue

Hi,

I’m not all that au fait with XSLT and I need to map data from an XML which contains NameSpaces.

I am getting the following error:
com.wm.pkg.xslt.util.LocalizedTransformerException: [XSL.0002.9002] JAXP: Error during transformation -
The prefix “ns0” for element “ns0:SORequest” is not bound.; Line#: 2; Column#: 16

The top of the XSLT is as follows:

<xsl:stylesheet version=“1.0” xmlns:xsl=“[URL]http://www.w3.org/1999/XSL/Transform[/URL]
xmlns:fo=“[URL]http://www.w3.org/1999/XSL/Format[/URL]
xmlns:ns0=“[URL]http://www.clientcompany.com/Project/SalesOrder[/URL]
exclude-result-prefixes=“fo”>

<xsl:output method=“xml” indent=“yes”/>
<xsl:template match=“ns0:SORequest”>
<xsl:call-template name=“processSORequest”/>
</xsl:template>

I don’t understand why the prefix “ns0” is not bound as I have defined it ??

Can anyone give me any pointers or help ??

Cheers,
David

I don’t have information for your query but I’m curious as to why you’re using XSLT? Is it easier to do the desired transformation in XSLT instead of in FLOW steps?

David,

I looked through some working code, and the namespace in the xsl is used exactly the way you have it. Perhaps the input document has the namespace defined slightly different.

If that’s not it, you could always remove the dependency on the ns0 namespace, match=“[local-name()=‘SORequest’]”.

Yeah, figured it out… The namespace needs to be defined in the the root tag of the XML input to the XSLT as such:

<?xml version="1.0"?>

<ns0:SORequest xmlns:ns0=“[URL]http://www.clientcompany.com/Project/SalesOrder[/URL]”>

Hey Reamon,
Yeah I was sceptical of using XSLT at first, but, I have discovered that XSLT is so powerful and there are so many more functions available in it than just normal flow code… For example, it takes just a few lines of XSLT to sort an input XML data file to ensure that it is in the correct order.

Just my 2 cents…