[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: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 30 May 2002 15:31:35 +0100
xsl test function last
> I've had to use "self::node()[position()=last()]" instead of simply 

the step self::node() constructs a current node list with exactly one
element so position() and last() will always be 1, so position()=last()
is always true().

so "self::node()[position()=last()]" is equivalent to self::node()

As you are using this is a boolean context it is true as self::node() is
always non empty, and as | is effectively or-ing together the boolean
values, 
            <xsl:if test="following-sibling::table | 
following-sibling:list | self::node()[position()=last()]">

is equivalent to <xsl:if test="true()">

which is equivalent to ""

I _think_ you want the test to be true just in the case that the only
following nodes (if there are any) are table or list, in which case
that is

<xsl:test="not(following-sibling::node()[not(self::table or self::list)])">

Note if you use node() then all nodes will be tested including any white
space nodes between the elements. If you only want to test following
elements then use * not node()

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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.