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

RE: problem with last() function

Subject: RE: problem with last() function
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 30 May 2002 15:48:45 +0100
xsl last function
self::node()[position()=last()] is exactly analogous to
child::node()[position()=last()] - it finds all the nodes on the self
axis and from these, selects the last one.

instead of "| self::node()[position()=last()]", write "or
position()=last()". Alternatively, write "or
not(following-sibling::node())" - which is less dependent on how your
template happens to be called, and may be cheaper to evaluate.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> John Walker
> Sent: 30 May 2002 15:05
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  problem with last() function
> 
> 
> Hi All!
> 
>     I want to know if a node is followed by some particular 
> nodes or if 
> it's the last node of the set. So I've tried:
> 
>             <xsl:if test="following-sibling::table | 
> following-sibling:list | self::node()[position()=last()]">
> 
> I've had to use "self::node()[position()=last()]" instead of simply 
> "position()=last()" because this last comparison doesn't return a DOM 
> node (wich seems to enter in conflict with the previous 
> comparisons)... 
> but it doesn't work! "self::node()[position()=last()]" always returns 
> the current node, doesn't matter if it's the last or not.
> I've an alternative solution, but I'd like to know why this 
> particular 
> expresion doesn't work! (...despite of curiosity killed the cat...)
> 
> Thanx a lot!
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.