I have a XSL file to transfer another XSL file. I want the namespace declaration to be on the root tag, instead of it being repeated on every single element!!
Here is my stylesheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mynamespace="somenamespace"
version="2.0">
<xsl:output method="xml" omit-xml-declaration="no" standalone="yes" indent="yes"/>
<xsl:template match="myMatchedNode">
<mynamespace:tag>Some text i want inserted into the xsl</mynamespace:tag>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
It outputs something like this:
....
<mynamespace:tag xmlns:mynamespace="somenamespace">Some text i want inserted into the xsl</mynamespace:tag>
....
How do i force the namespace declaration onto the root tag of the result?!