This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How do you count nesting level



> <xsl:param name="Depth" select="count(ancestor::*[section])" />

that counts (if you do not pass any other value as the parameter)
the number of ancestors that have a section child. In your example this
will be 0 for titles 1 to 4 and 1 for title 5.

You said you wanted 

> Title 1 and 2 are at level 1. Title 3 and 4 are at level 1. Title 5 is at 
> level 2.

which looks like count(ancestor::section)

David


_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]