Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List XML attributes values
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*">
<xsl:for-each select="@format">
<xsl:text>format: </xsl:text>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:for-each select="@type">
<xsl:text>type: </xsl:text>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment