[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Position operator

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


position operator
[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: http://xquery.com/mailman/listinfo/talk 
> [mailto:http://xquery.com/mailman/listinfo/talk] On Behalf Of Ronald Bourret
> Sent: Monday, January 23, 2006 12:23 AM
> To: xquery-talk
> Subject:  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
> 
> _______________________________________________
> http://xquery.com/mailman/listinfo/talk
> http://xquery.com/mailman/listinfo/talk
> 



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
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-2011 All Rights Reserved.