|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
re: node push down/pull upI 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 |
|
|
Re: node push down/pull upDo 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.li@...> 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 > > |
|
|
Re: node push down/pull upThanks, 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 <nshilenkova@...> wrote: Do you use XUpdate to update documents? If so, you can try this query: |
|
|
Re: node push down/pull upOn Mon, Jul 13, 2009 at 9:53 PM, Tak-po Li<takpo.li@...> 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 > > |
|
|
Re: node push down/pull upThanks, 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 <nshilenkova@...> wrote:
|
| Free embeddable forum powered by Nabble | Forum Help |