[Home] [By Thread] [By Date] [Recent Entries]
Florian Bauer wrote:
and now my 2nd (and hopefully last) question for today ...Forget about incrementing a variable, there is no such thing in XSLT. Sort all elements by number of ancestors and take the first one. <xsl:template match="/"> <xsl:for-each select="//*"> <xsl:sort select="count(ancestor::*)" data-type="number" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="count(ancestor::*)+1"/> </xsl:if> </xsl:for-each> </xsl:template> -- Oleg Tkachenko http://www.tkachenko.com/blog Multiconn Technologies, Israel XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



