Created
September 21, 2011 17:29
-
-
Save sachin-handiekar/1232731 to your computer and use it in GitHub Desktop.
Add namespace in root node using XSLT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vbs="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt"> | |
<xsl:output omit-xml-declaration="yes" /> | |
<xsl:template match="node()|@*"> | |
<xsl:copy> | |
<xsl:apply-templates select="node()|@*" /> | |
</xsl:copy> | |
</xsl:template> | |
<!-- Just change the match="/*" to match="*" ; if you want to add namespace in all elements --> | |
<xsl:template match="/*"> | |
<xsl:element name="ns:{local-name()}" namespace="http://www.example.com"> | |
<xsl:apply-templates select="node()|@*" /> | |
</xsl:element> | |
</xsl:template> | |
</xsl:stylesheet> |
jokr0815
commented
Sep 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment