Next in thread → Next in month →

Re: [xml-dev] XQuery Puzzle

From
David Carlisle <>
To
Date
2008-04-17T22:29:25Z
ID
<>
Thread
Re: [xml-dev] XQuery Puzzle
> would the result be any different ?

no xpath 1 and 2 would be the same in that case.

> '... The xpath 2.0 spec is unclear regarding multiple predicates,
I'm not sure what part os unclear but predicates (in xpath 1 and 2, and
xquery) are evaluated left to right, with for example  last() a being
re-calculated after each predicate to refect the number of items
remaining.

> it would seem that, at least for eXist and Saxon, the first predicate
> causes the expression to evaluate to a sequence before the last
> predicate is considered.' yes, but note

preceding-sibling::div1[@class="doc"][1]

is different from

(preceding-sibling::div1[@class="doc"])[1]

in the first case you get the closest matching iten, and in the second
case you get the first one in documet order, ie the one furthest from
the current node.

David
Next in thread → Next in month →