This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Proper syntax for counting all prior nodes in XPath? (revised)
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Proper syntax for counting all prior nodes in XPath? (revised)
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Tue, 12 Jun 2001 19:06:45 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> How can my XSL count all the preceding nodes within the same
> chapter?
The simplest way is probably xsl:number
<xsl:variable name="count">
<xsl:number level="any" count="*"/>
</xsl:variable>
Or you can probably do it with XPath, by adding a condition
[generate-id(ancestor::chapter) = generate-id(current()/ancestor::chapter)]
Mike Kay
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list