[xquery-talk] Position operator

Michael Rys mrys at microsoft.com
Mon Jan 23 01:12:03 PST 2006


[1] binds stronger than / or //. 

So in the first case you get the first one under every descendant node.

In the second one you get the first.

Best regards
Michael 

> -----Original Message-----
> From: talk-bounces at xquery.com 
> [mailto:talk-bounces at xquery.com] On Behalf Of Ronald Bourret
> Sent: Monday, January 23, 2006 12:23 AM
> To: xquery-talk
> Subject: [xquery-talk] Position operator
> 
> I'm missing something obvious here.
> 
> Suppose book.xml contains multiple title elements. Why does:
> 
>     doc("book.xml")//title[1]
> 
> return a sequence of all title elements and:
> 
>     (doc("book.xml")//title)[1]
> 
> return the first title element? I would have thought both 
> queries would 
> return the first title element.
> 
> Thanks,
> 
> -- Ron
> 
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
> 



More information about the talk mailing list