Skip to content

Instantly share code, notes, and snippets.

@benoitpointet
Created December 9, 2011 06:13
Show Gist options
  • Save benoitpointet/1450437 to your computer and use it in GitHub Desktop.
Save benoitpointet/1450437 to your computer and use it in GitHub Desktop.
XSL transform that empties an xml file of all its content, retains structure
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="*" />
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:attribute name="{name()}" />
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment