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

Re: Function's at XSLT

Subject: Re: Function's at XSLT
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 27 Nov 2003 14:36:45 GMT
xsl filter current node sum
The filter step [last()] will be false for every node except the last.
So if your sequence is the current node list in a step then just adding
[last()] will do what you want.

If your sequence is the current node list in an xsl:for-each then use
<xsl:if test="position()=last()">....

Note that XPath1 does not have a sequence datatype node sets are sets so
inherently unordered so it don't really have a first or last node until
your sort the elements into document order (as happens in forward axes)
or reverse order (reverse axes) or with xsl:sort.

In xpath2 you can save a sequence in arbitrary order in a variable, then
$x[last()]
will give you the last in the sequence.

> Where can I find a fast guide with all function's that can possible used in
> xslt 

apart from a few special functions (eg current() key() and documen())
all the functions are listed in teh Xpath spec at www.w3.org/tr/xpath

David



-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.