Skip to content

Instantly share code, notes, and snippets.

@emiliano-poggi
Created June 11, 2011 05:22
Show Gist options
  • Select an option

  • Save emiliano-poggi/1020275 to your computer and use it in GitHub Desktop.

Select an option

Save emiliano-poggi/1020275 to your computer and use it in GitHub Desktop.
XSLT: "local" identity
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()[not(self::*)]">
<xsl:copy/>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
@emiliano-poggi

Copy link
Copy Markdown
Author

This identity rule copies all nodes removing any namepsace prefix.

Credits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment