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

Re: sorted for-each: preceding::sibling is not in sort

Subject: Re: sorted for-each: preceding::sibling is not in sort order
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sun, 13 Nov 2005 15:35:53 GMT
you sorted for
> It took me a long time to find out that while for-each will present the
> nodes in sort order, preceding::sibling will give me the
> results for a totally different node (probably document order).

all axes always refer to the input tree, not the current node list. The
siblings (and parent) of a node are, like its children, properties of
the node,not properties of the particular set of nodes currently
selected or the order in which they are processed.

> Is this intended behaviour (I'm working with Xalan)? 

yes

> And if so, what is the best way around this.

it depends what you are doing. Sometimes doing it in two passes as you
suggest, first sortung and then processing, is the best way, sometimes
you can do it in one pass. It all depends what it is that you want to
do.


> One big disadvantage being that I'm cutting off all the parent
> relationships when copying my node.

you can copy the parent, or potentially the whole document, first make a
copy of the document, with just the nodes re-ordered that you want to
reorder, then process the new document. But as I say sometimes two
passes are not necessary.

David

________________________________________________________________________
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:
http://www.star.net.uk
________________________________________________________________________

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.