Skip to content

Instantly share code, notes, and snippets.

@darrelmiller
Last active Dec 12, 2015
Embed
What would you like to do?
Convert attributes to elements throughout a document
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@*">
<xsl:element name="{name()}"><xsl:value-of select="."/></xsl:element>
</xsl:template>
<xsl:template match="/ | @* |node()">
<xsl:copy>
<xsl:apply-templates select="* | @* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment