[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XQuery Puzzle
Ok, I was asking the question about whether there is any difference in XPath 1 and 2 when evaluating expressions with multiple predicates *in general* rather than siting the earlier example. But to make it clear, if I change the earlier example to that suggested by Andrew (note the added <foo>) :- let $set := (<foo> <div1>one</div1>, <div1 class="doc">two</div1>, <div1>three</div1>, <div1 class="doc">four</div1>, <gotcha>START</gotcha>, <div1>five</div1></foo> ) return $set//gotcha/preceding-sibling::div1[@class="doc"][1] would the result be any different ? Michael stated above that XQuery always uses XPath 2.0 so maybe this is a red herring, however, I was asking because the OP that raised this question on the Exist forum, made this statement .. '... The xpath 2.0 spec is unclear regarding multiple predicates, but 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.' Fraser. On 17/04/2008, David Carlisle <davidc@n...> wrote: > > > Is there any difference in the way that XPath 1.0 and 2.0 evaluate > > multiple predicates like this (there was a different result between > > some of the XQuery processors used and it wasn't clear whether these > > implemented XPath 1.0 or 2.0) ? > > the reason the expression did not generate the result that you exected > was that the input consisted of a sequence of parentless elements. > > parentless elements do not exist in the Xpath1 data model so this > situation can not arise in that case. > > > David > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|