Skip to content

Instantly share code, notes, and snippets.

@bmix
Forked from emiliano-poggi/local-identity.xsl
Created June 24, 2020 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmix/4fc6c088fb33a80e4ea38e41b9b42adb to your computer and use it in GitHub Desktop.
Save bmix/4fc6c088fb33a80e4ea38e41b9b42adb 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment