This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: enumerating things (global counter)
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>, "'Andreas Leitner'" <nozone at sbox dot tugraz dot at>
- Date: Wed, 17 Apr 2002 17:52:52 +0100
- Subject: RE: [xsl] enumerating things (global counter)
- Reply-to: xsl-list at lists dot mulberrytech dot com
>
> It takes into account all "preceding" requirements, but "preceding" in
> XPath terms doesn't include ancestors, and you want to include
> ancestors in your numbering. So use:
>
> <xsl:value-of
> select="count(preceding::requirement |
> ancestor::requirement) + 1" />
>
Or use <xsl:number level="any"/> which does much the same thing.
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list