RE: deepest node
I cut this from http://www.dpawson.co.uk/xsl/sect4/svg.html#d11254e206, which I found by searching google using "xsl deepest node" Hope this helps, Josh <!-- calculates the depth of the deepest ancestor (so we have an idea of how many levels deep the tree will be): a 'max' trick --> <xsl:variable name="deepest"> <!-- returns the depth (in ancestors) of the deepest node(s) --> <xsl:for-each select="//node()[not(node())]"> <xsl:sort select="count(ancestor-or-self::*)" order="descending" data-type="number"/> <xsl:if test="position()=1"> <xsl:value-of select="count(ancestor-or-self::*)"/> </xsl:if> </xsl:for-each> </xsl:variable> -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Bennett Sent: Wednesday, February 11, 2004 1:16 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: deepest node Hello, How do I find the deepest node in a document? TIA XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-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