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

Re: XQuery Puzzle

  • From: "Fraser Goffin" <goffinf@g...>
  • To: xml-dev@l...
  • Date: Thu, 17 Apr 2008 22:47:41 +0100

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!

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.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.