Re: node push down/pull up

Natalia Shilenkova <[email protected]> Tue, 14 Jul 2009 14:47:37 -0400
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
On Mon, Jul 13, 2009 at 9:53 PM, Tak-po Li<[email protected]> wrote:
>
>
> Thanks, Natalia, for your detail explanation.=A0 If I understand it right=
, we
> use variable Var to point to the portion of the tree that we want to keep
> and build the=A0new tree with new node B and Var.=A0 Question:=A0Do we cr=
eate=A0a
> duplicate tree and delete the old one=A0or just switch the pointers aroun=
d?

You are absolutely correct in your understanding of how the query
works. As for the question, this query will duplicate the part of the
document that is assigned to the variable. It does not seem to be
possible to move nodes in the document with XUpdate, at least I could
not figure it out.

It is also possible to read document from database, then to modify it
using DOM, and finally to save it to database again. In this case you
can have greater flexibility and can do the same thing as XUpdate
query in question without copying parts of the document. However, I
doubt this method will be any better because it would mean serializing
document and transferring it between client and the server, while
XUpdate query modifies documents on the server.

Regards,
Natalia

>
> Thanks again.
>
> Tak
>
>