Re: [xsl] XPath 2.0

Subject: Re: [xsl] XPath 2.0
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 8 Jan 2002 16:03:21 +0000
Miloslav Nic wrote:
> In:
> http://web3.w3.org/TR/xpath20/#id-order-comparisons
>
> Order Comparisons
>
> precedes operator is defined:
>
> A comparison with the precedes operator returns true if the first
> operand node is reachable from the second operand node using the
> preceding axis; otherwise it returns false.
>
> Is there any reason why not to use ancestor and preceding axis in
> the comparison?

I might be reading it wrong, but I think that the << operator is
supposed to cover the combination of ancestor and preceding axes. So
if you did:

  id('a1') << id('a2')

then you'd get 'true' because the node with ID a1 comes before the
node with ID a2 in document order.

Presumably the 'precedes' operator is useful in the same kinds of
situations as the 'preceding' axis is useful, although I'm not sure I
could give you any examples.

The subtle difference between 'precedes' and '<<' (and between
'follows' and '>>') will probably cause much head-scratching.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread