You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by Michael Lancaster <m....@ph.unimelb.edu.au> on 2004/06/28 12:42:58 UTC

moving a node

hi everyone,

 

this seems like a pretty fundamental thing to need to do, so i figure i am
probably missing something obvious, but how do you use xmlbeans to move a
node within the document?

 

my first thought was to use xcursor, but the cursor returned seems to be
local to the xmlObject from whence it is called.

 

so, for instance, if i have three xmlObjects A, B and C at arbitrary
locations in the tree, where C is a child of B for instance, and I wish to
make C a child of A instead, how would this be done?

 

If i call B.newCursor(), and navigate to C. Then call 

 

aCursor = A.newCursor(), 

 

can i simply apply B.moveXml(aCursor)? 

 

when i tried this, it seemed as though each cursor was local to the document
fragment of it's xmlObject.

 

Sorry if this post is a bit confusing :)

 

thanks,

 

michael