|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] selectionMichael Kay mhk at mhk.me.ukSun Feb 5 23:54:15 PST 2006
> 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! 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
|

Cart








