[Home] [By Thread] [By Date] [Recent Entries]
rowan@xxxxxxxxxxxxxxxxxxxxx wrote:
Here is an XSLT 1.0 way: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output indent="yes"/> <xsl:template match="items">
<xsl:copy>
<xsl:apply-templates select="descendant::item"/>
</xsl:copy>
</xsl:template> <xsl:template match="item">
<xsl:copy>
<level><xsl:value-of select="count(ancestor::item)"/></level>
<xsl:copy-of select="*[not(self::item)]"/>
</xsl:copy>
</xsl:template></xsl:stylesheet> -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|

Cart



