Re: node push down/pull up
Tak-po Li <[email protected]> Mon, 13 Jul 2009 21:53:56 -0400
| Newsgroups | gmane.text.xml.xindice.user |
|---|---|
| Message-ID | <[email protected]> |
--00163646bf8a21b7fe046ea0b63a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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? Thanks again. Tak On Mon, Jul 13, 2009 at 8:35 AM, Natalia Shilenkova <[email protected]>wrote: > Do you use XUpdate to update documents? If so, you can try this query: > > <xupdate:modifications version="1.0" > xmlns:xupdate="http://www.xmldb.org/xupdate"> > > <xupdate:variable name="var" select="/a/*"/> > > <xupdate:remove select="/a/*"/> > <xupdate:append select="/a"> > <b></b> > </xupdate:append> > <xupdate:append select="/a/b"> > <xupdate:value-of select="$var"/> > </xupdate:append> > </xupdate:modifications> > > Regards, > Natalia > > > On Sat, Jul 11, 2009 at 10:34 AM, Tak-po Li<[email protected]> wrote: > > > > I am new with xindice. What is the best way to insert/remove a node > level? > > > > As an example, make > > <a> > > <m> > > .... > > </m> > > </a> > > into > > <a> > > <b> > > <m> > > .... > > </m> > > </b> > > </a> > > and vice verse. > > > > Thanks, > > > > Tak > > > > > --00163646bf8a21b7fe046ea0b63a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div>=A0</div> <div>=A0</div> <div>Thanks, Natalia, for your detail explanation.=A0 If I understand it ri= ght, we use variable Var to point to the portion of the tree that we want t= o keep and build the=A0new tree with new node B and Var.=A0 Question:=A0Do = we create=A0a duplicate tree and delete the old one=A0or just switch the po= inters around?</div> <div>=A0</div> <div>Thanks again.<br><br>Tak</div> <div>=A0</div> <div>=A0</div> <div class=3D"gmail_quote">On Mon, Jul 13, 2009 at 8:35 AM, Natalia Shilenk= ova <span dir=3D"ltr"><<a href=3D"mailto:[email protected]">nshilenk= [email protected]</a>></span> wrote:<br> <blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex= ; PADDING-LEFT: 1ex" class=3D"gmail_quote">Do you use XUpdate to update doc= uments? If so, you can try this query:<br><br><xupdate:modifications ver= sion=3D"1.0"<br> xmlns:xupdate=3D"<a target=3D"_blank" href=3D"http://www.xmldb.org/xup= date">http://www.xmldb.org/xupdate</a>"><br><br>=A0<xupdate:vari= able name=3D"var" select=3D"/a/*"/><br><br>=A0<xu= pdate:remove select=3D"/a/*"/><br> =A0<xupdate:append select=3D"/a"><br>=A0 =A0<b></b= ><br>=A0</xupdate:append><br>=A0<xupdate:append select=3D"= /a/b"><br>=A0 =A0<xupdate:value-of select=3D"$var"/>= ;<br>=A0</xupdate:append><br> </xupdate:modifications><br><br>Regards,<br><font color=3D"#888888">N= atalia<br></font> <div> <div></div> <div class=3D"h5"><br><br>On Sat, Jul 11, 2009 at 10:34 AM, Tak-po Li<<a= target=3D"_blank" href=3D"http://takpo.li/">takpo.li</a>@<a target=3D"_bla= nk" href=3D"http://gmail.com/">gmail.com</a>> wrote:<br>><br>> I a= m new with xindice.=A0 What is the best way to insert/remove a node level?<= br> ><br>> As an example, make<br>> =A0 <a><br>> =A0 =A0 <= m><br>> =A0=A0=A0=A0=A0 ....<br>> =A0 =A0 </m><br>> =A0 &= lt;/a><br>> into<br>> =A0 <a><br>> =A0=A0=A0 <b><br= >> =A0 =A0 <m><br>> =A0=A0=A0=A0=A0 ....<br> > =A0 =A0 </m><br>> =A0 =A0 </b><br>> =A0 </a><b= r>> and vice verse.<br>><br>> Thanks,<br>><br>> Tak<br>><= br>><br></div></div></blockquote></div><br> --00163646bf8a21b7fe046ea0b63a--