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

Re: Sequences in XSLT 2.0..

Subject: Re: Sequences in XSLT 2.0..
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 14 Mar 2005 17:18:45 GMT
allowed sequences
> Now everything is a sequence.
> Earlier everything was a node-set.

not quite true. In XSLT2 everything is a sequence but in xslt1 atomic
values such as numbers and strings were not in a node set or a sequence.

One advantage of sequences is that you can store sequences of strings
etc ("a","b", ....)

The other is that sequences become first class objects that may be saved
in variables and re-used. XSLT1 had sequences (called lists there)
but these were just transient objects "the current node list"
that could not be stored.

If you go select="ancestor::*[2]" then just inside the step the current
node list is the ancestors in reverse document order so [2] selects your
grandparent, but this could not be stored, 
,xsl:variable name="x" select="ancestor::*"/>
selects the unordered set of ancestors then 
orders that set in document order so [2] selects teh grandchild of the
document element.

Similarly inside
<xsl:for-each select="zzzz">
 <xsl:sort select="mmm"/>

the current node list is the ordered list sorted by mmm but that list
can not be saved in order, if you need it again later you have to
re-sort. In XSLT2 sorted sequences can be saved.

Other reasons have to do with alignment with xsd schema but they are,
natutrally:-) almost all bad, but on balance ordered sequences are
probably a good thing (although perhaps they might have been better
still if they had allowed sequences of sequences)


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

Current Thread


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.
First Name
Last Name
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.