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

Re: Reverse order axis operators...

Subject: Re: Reverse order axis operators...
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 12 Jan 2002 16:35:09 GMT
reverse read order xml node

> All the reference material abd W3c reading says that these four Axis should
> return node-list in reverse document order.
They are reverse axese but that only means that they essentially collect
their nodes in reverse order so ancestor::*[1] is the parent, ie the
first ancestor going up.

However the value of such an Xpath expression is a node set. Sets
(unlike lists) do not have an order. So it does not matter whether you
collect nodes using a forward or reverse axis or a combination of the
two, the resuult of an expression is always an unordered set.

When you come to iterate over that set using xsl:for-each the for-each
sorts then into document order or some other order specified by xsl:sort
but note it is the for-each (or copy-of) taht is ordering the set not
that the set itself has any intrinsic order that "remembers" the order
in which it was selected.

David
PS
a)this is a FAQ I'm sure that the faq for this list has more info
b) this is an XPath 1 answer. In the Xpath2 working draft (which is a
very new draft and not in msxml) the semantix of these expressions are 
described in terms of sequences (ie ordered lists) rather than unordered
sets, but the result is the same a for-each iterating over ancesto::*
iterates over the nodes in document (forwards) order.



_____________________________________________________________________
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.