I need to add an xmlns to the root element in the output of this XSLT transform. I've tried added <xsl:attribute name="xmlns">
but it's disallowed.
Has anyone got any ideas how I could solve this?
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<xsl:variable name="rootElement" select="name(*)"/>
<xsl:element name="{$rootElement}">
<xsl:apply-templates select="/*/*"/>
</xsl:element>
</xsl:template>
<xsl:template match="node()">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>