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

selection

Michael Kay mhk at mhk.me.uk
Sun Feb 5 23:54:15 PST 2006


selection of messages for thanksgiving
> suppose i have this xml file book.xml
> <bookstore>
> <book>
> 	<title>seven years in trenton</title>
> 	<price>12</price>
> 
> </book>
> <book>
> 	<title> history of trenton</title>
> 		<price> 55</price>
> </book>
> </bookstore>
> 
> when I issue the following statement
> let $j:= doc("book.xml")//book [price > 12]
> $j discarded the book with 12 price but my problem is
> that $j now is standing at node book, I want $j to
> discard the book with 12 and stop at bookstore(the
> root)

You can't modify the input document: the original bookstore element will
always contain two books. But you can construct a new bookstore element
containing only one book like this:

let $j := <bookstore> {
     doc("book.xml")//book [price > 12]
} </bookstore>

Michael Kay
http://www.saxonica.com/




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