Re: node push down/pull up

Tak-po Li <[email protected]> Tue, 14 Jul 2009 16:21:27 -0400
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
--0016363b845cec142a046eb02ebb
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Thanks, Natalia, for your in depth answers.  Understanding it would help me,
in my application, to avoid using a deep xml tree.

Thanks again.

Tak

On Tue, Jul 14, 2009 at 2:47 PM, Natalia Shilenkova
<[email protected]>wrote:

> On Mon, Jul 13, 2009 at 9:53 PM, Tak-po Li<[email protected]> wrote:
> >
> >
> > Thanks, Natalia, for your detail explanation.  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 new tree with new node B and Var.  Question: Do we create a
> > duplicate tree and delete the old one or just switch the pointers around?
>
> 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
> >
> >
>

--0016363b845cec142a046eb02ebb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>=A0</div>
<div>Thanks, Natalia, for your in depth answers.=A0=A0Understanding it=A0wo=
uld help me, in my application,=A0to avoid using=A0a deep xml tree.=A0 </di=
v>
<div>=A0</div>
<div>Thanks again.</div>
<div>=A0</div>
<div>Tak<br><br></div>
<div class=3D"gmail_quote">On Tue, Jul 14, 2009 at 2:47 PM, Natalia Shilenk=
ova <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">nshilenk=
[email protected]</a>&gt;</span> wrote:<br>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im">On Mon, Jul 13, 2009 at 9:53 PM, Tak-po Li&lt;<a target=
=3D"_blank" href=3D"http://takpo.li/">takpo.li</a>@<a target=3D"_blank" hre=
f=3D"http://gmail.com/">gmail.com</a>&gt; wrote:<br>&gt;<br>&gt;<br>&gt; Th=
anks, Natalia, for your detail explanation.=A0 If I understand it right, we=
<br>
&gt; use variable Var to point to the portion of the tree that we want to k=
eep<br>&gt; and build the=A0new tree with new node B and Var.=A0 Question:=
=A0Do we create=A0a<br>&gt; duplicate tree and delete the old one=A0or just=
 switch the pointers around?<br>
<br></div>You are absolutely correct in your understanding of how the query=
<br>works. As for the question, this query will duplicate the part of the<b=
r>document that is assigned to the variable. It does not seem to be<br>
possible to move nodes in the document with XUpdate, at least I could<br>no=
t figure it out.<br><br>It is also possible to read document from database,=
 then to modify it<br>using DOM, and finally to save it to database again. =
In this case you<br>
can have greater flexibility and can do the same thing as XUpdate<br>query =
in question without copying parts of the document. However, I<br>doubt this=
 method will be any better because it would mean serializing<br>document an=
d transferring it between client and the server, while<br>
XUpdate query modifies documents on the server.<br><br>Regards,<br>Natalia<=
br><br>&gt;<br>&gt; Thanks again.<br>&gt;<br>&gt; Tak<br>&gt;<br>&gt;<br></=
blockquote></div><br>

--0016363b845cec142a046eb02ebb--