[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Determining last node

Subject: Determining last node
From: "Larry Garfield" <lgarfiel@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 13 Aug 2001 15:33:15 -0500
xslt determine last node
I am trying to determine if a given node is the last of its kind, either
within its own siblings or in the entire document.

The document structure is:

book
 chapter
  sect1
  sect1
 chapter
  sect1
  sect1
  sect1
 chapter
  sect1

I am trying

...
<xsl:when test="$chNum=$source/book/chapter[last()]">
...

when processing the chapters in a template called from inside a for-each
($chNum is the <xsl:number/> value of the chapter node, passed in from the
template call).

I am trying

...
<xsl:when test="$sectNum=count($source//sect2)">
...

when processing the sect1 nodes inside a template called from inside a
for-each that processes all sect2 nodes at once, regardless of their
chapter.

However, neither one is catching.  Processing is always passing to the
<xsl:otherwise> block.  What xpath statement do I need to use to determine
if the current chapter element or sect1 element is the "last of its kind"?

Thanks in advance.

--Larry Garfield


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.