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 <nshilenk...@gmail.com>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<takpo...@gmail.com> 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 > > > > >