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

Subject: Re: [Fwd: RE: [xsl] Need help OR'ing in XPATH.]
From: Glen Mazza <grm7793@xxxxxxxxxxx>
Date: Wed, 22 Mar 2006 07:37:14 -0500
Michael Kay wrote:


Putting that together:


select="book[owner is "aaa" or chapter/owner='aaa']

ALternatively you could write

select="book[owner is "aaa"] | book[chapter/owner='aaa']

The "|" operator here forms the union of two sets.

In both cases the results will be in document order, as required.


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.


Glen

[1] http://www.w3.org/TR/xpath#node-sets

Current Thread