I have a document of which the root element defines a namespace, when I write a xsl to transform I don't see any elements matched.
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="//supplydetail/price"/>
</xsl:stylesheet>
The XML file looks like this:
<?xml version="1.0" encoding="iso-8859-1"?>
<ONIXmessage xmlns="http://www.editeur.org/onix/2.1/short">
<header>
<m173>2012086</m173>
<m174>foobar</m174>
</header>
<product>
<supplydetail>
<j137>Foo Bar</j137>
<j396>20</j396>
<price>
<j148>42</j148>
<j151>5.99</j151>
<j152>AUD</j152>
<b251>AU</b251>
</price>
</supplydetail>
</product>
</ONIXmessage>
What I see is that my supplydetail/price
element is not matched at all even when it exists in the document at /ONIXmessage/product/supplydetail/price
I tried to specify the full path from root as well in the xsl and that din't work either. The output I get is a straight copy of the input, what I am expecting is that a copy of the input except the price element. I think the reason is the namespace declaration in ONIXmessage element of the input XML, but how do I specify that in the xsl.
Thanks