I have an XML document with a default namespace indicated at the root. Something like this:
<MyRoot xmlns="http://www.mysite.com">
<MyChild1>
<MyData>1234</MyData>
</MyChild1>
</MyRoot>
The XSLT to parse the XML does not work as expected because of the default namespace, i.e. when I remove the namespace, everything works as expected.
Here is my XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:template match="/" >
<soap:Envelope xsl:version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<NewRoot xmlns="http://wherever.com">
<NewChild>
<ChildID>ABCD</ChildID>
<ChildData>
<xsl:value-of select="/MyRoot/MyChild1/MyData"/>
</ChildData>
</NewChild>
</NewRoot>
</soap:Body>
</soap:Envelope>
</xsl:template>
</xsl:stylesheet>
What needs to be done with XSLT document so that translation works properly? What exactly needs to be done in XSLT document?