[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: deepest node

Subject: RE: deepest node
From: "Josh Canfield" <Josh.Canfield@xxxxxxxxxxxx>
Date: Wed, 11 Feb 2004 14:32:01 -0800
xsl 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


Current Thread
  • deepest node
    • Bennett - Wed, 11 Feb 2004 16:23:57 -0500 (EST)
      • <Possible follow-ups>
      • Josh Canfield - Wed, 11 Feb 2004 17:32:28 -0500 (EST) <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.