|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Help with multiple deletesMartin Probst mail at martin-probst.comSat Aug 29 17:47:16 PDT 2009
> After I spent a nice chunk of time testing this in stylus studio, I took the
> concept and ported it into our application. Only to discover that the
> implementation we are using, MXQuery 0.6.0, does not support ancestor!
> Argh.. =) So if anyone thinks it can possibly be rewritten without using
> ancestor (or any other axes I’m guessing), please share your thoughts. But
> I think we are going to end up using an XSLT for this operation.
You could simply transform twice, which might be less efficient, but
its certainly simpler to write:
copy $x := doc("tree.xml")
modify (
delete node $x//tree[@ID = 1] /branch[@ID = 2] /branch[@ID =
13] /branch[@ID = 65] /branch[@ID = 15] /leaf[@ID = 25]
)
return
copy $y := $x
modify (
delete node $x//tree//branch[count(.//leaf) = 0]
,
delete node $x//tree[count(.//branch) = 0]
)
return $y
Martin
|
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
|






