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

Re: [Fwd: RE: Need help OR'ing in XPATH.]

Subject: Re: [Fwd: RE: Need help OR'ing in XPATH.]
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 22 Mar 2006 12:50:10 GMT
Re: [Fwd: RE:  Need help OR'ing in XPATH.]
> Thanks--it worked, I used the first one.  As for the second, I saw the | 
> operator earlier but was concerned that it won't guarantee that it 
> *would* be in document order.  The XPath spec seems to be vague on 
> this[1] -- i.e., whether I can guarantee document order with it, *or* it 
> just so happens that they way the major XSLT implementations implement 
> this operator result in it being in document order.

A node set (as generated by a path expression or the | operator) _never_
specifies an order in xpath1(that's why it is called a set rather than a
list or a sequence). However XSLT1 operations like xsl:apply-templates
and xsl:for-each always (effectively) process teh nodes in the selected node
set in documet order so

<xsl:for-each select="a|b">

is guaranteed to output the result of b before the result of a if b is
earlier than a in document order.

This node set model is dropped in XPath2 which uses ordered sequences as
a basic datatype.

So in XSLT2 <xsl:for-each select=" processes the _sequence_ supplied in
the select attribute in the order of items in the sequence and in xpath2
the union operator | is defined to merge the two sequences  and sort
them into document order.

So the end result in  xslt2 is the same, teh ordering is guaranteed.


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.