[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: count Nodes with attributes until... (XSLT 1.0)
Hi Jan, Please try the following stylesheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" /> <xsl:template match="/theExampleXMLTree"> <xsl:text>NodeNr.|Value 
</xsl:text> <xsl:for-each select="Node"> <xsl:variable name="count"> <xsl:call-template name="XYZ"> <xsl:with-param name="nodeset" select="following-sibling::*" /> <xsl:with-param name="n" select="0" /> </xsl:call-template> </xsl:variable> <xsl:value-of select="position()" />|<xsl:value-of select="$count" /><xsl:text>
</xsl:text> </xsl:for-each> </xsl:template> <xsl:template name="XYZ"> <xsl:param name="nodeset" /> <xsl:param name="n" /> <xsl:choose> <xsl:when test="$nodeset[1]/@count-me = 'yes'"> <xsl:call-template name="XYZ"> <xsl:with-param name="nodeset" select="$nodeset[position() > 1]" /> <xsl:with-param name="n" select="$n + 1" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$n" /> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> Regards, Mukul On 6/28/06, news@xxxxxxxxxxx <news@xxxxxxxxxxx> wrote: Hello List,
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|