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: Proper syntax for counting all prior nodes in XPath? (revised)


> 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


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