Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Importing nodes

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: jcowan AT reutershealth.com
  • To: Tom Hurley <tom_hurley AT anabus.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Importing nodes
  • Date: Mon, 15 Dec 2003 15:21:20 -0500

Tom Hurley scripsit:

> I'm evaluating XOM to see if I can use it in my next project. I really like
> and agree with the philosophy behind its development but I need to be able
> to import a node from one document into another. Something equivalent to
> importNode in DOM or the detatch/addContent pair in JDOM. Can I do this with
> XOM?

No problem. In XOM, a node is not permanently bound to its document
the way a JDOM or DOM node is. Just use removeChild to remove it from
its parent node, and appendChild or insertChild to add it to the new
parent node.

BTW, Elliotte, there's a mild doco bug in Node.copy; it says the copied node
is not part of any document, but this is false when copying a Document node.

--
With techies, I've generally found John Cowan
If your arguments lose the first round http://www.reutershealth.com
Make it rhyme, make it scan http://www.ccil.org/~cowan
Then you generally can jcowan AT reutershealth.com
Make the same stupid point seem profound! --Jonathan Robie




Archive powered by MHonArc 2.6.24.

Top of Page