xq update: what gets deleted when you delete a node?

View: New views
2 Messages — Rating Filter:   Alert me  

xq update: what gets deleted when you delete a node?

by David Carlisle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



I just wrote in another thread:

> you are stuck because there is no node with the identity inner-a.

I can't actually see anything in the update  spec that says that if you
delete a node then its children are deleted. If you delete (or in the
example posted earlier, replace) a node, are its children still around?

If I go

let $a := <x><y/></x>, $b=$a/y
return
(
delete{$a},
$b
)

do I get <y/> as the value  of $b or has that node gone somewhere?

For that matter what do I get if I do


let $a := <x><y/></x>
return
(
delete{$a},
$a
)

what's the value of $a if it holds a deleted node?

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


Re: xq update: what gets deleted when you delete a node?

by David Carlisle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



me> what's the value of $a if it holds a deleted node?

answering my own question to close the thread and save anyone else doing it..

The current spec only defines upd:applyUpdates being applied to the
topmost expression, so the value of $a is the value it had before the
deletion, the deletion is pending and only happens after the whole thing
has been evaluated.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

LightInTheBox - Buy quality products at wholesale price!