[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XPath expression for finding out the depth of a gi
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 17 November 2002 10:10, Andreas Schildbach wrote: > Is there a XPath expression for finding out the depth of a given node (or > just the context node) in the document? Well, XPath has a count() function, and it also has the ancestor:: axis, and the '*' pattern to match any element. Put it all together, and you get count(ancestor::*). That should pretty much do it. If you want a 1- based count instead of a 0- count, use count(ancestor-or-self::*). - -- Peter Davis -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE91/elhDAgUT1yirARAlNFAJ4y3yfmm4CR0kc+jz2SEXiZEVMK3ACdGOA4 GHm1DmcVfeBBq2X76Y/ocTQ= =U9Pq -----END PGP SIGNATURE----- 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
|