Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 38909 invoked from network); 15 May 2000 15:05:25 -0000 Received: from ns0.connectfree.co.uk (root@212.1.130.33) by locus.apache.org with SMTP; 15 May 2000 15:05:25 -0000 Received: from ppp-1-109.cvx6.telinco.net ([212.1.156.109] helo=domserv.synergy-fs.com) by ns0.connectfree.co.uk with esmtp (Exim 2.12 #3) id 12rMKI-0002ai-00 for general@xml.apache.org; Mon, 15 May 2000 15:58:34 +0100 Received: by DOMSERV with Internet Mail Service (5.5.2448.0) id ; Mon, 15 May 2000 16:11:19 +0100 Message-ID: <6565B06C4C6BD311B15F0090279363888646@DOMSERV> From: Anthony Dodd To: "'general@xml.apache.org'" Subject: RE: Changing owner document Date: Mon, 15 May 2000 16:11:11 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="windows-1252" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi Steve Use the new DOM 2 oeg.w3c.dom.Document.importNode() method. Regards Tony -----Original Message----- From: Steve Chervitz [mailto:sac@neomorphic.com] Sent: 13 May 2000 00:57 To: general@xml.apache.org Subject: Changing owner document I recently started using Xerces-J coming from XML4J and have run into the following snag. I want to take a node from one document and add it to a node on a different document. Using XML4J, this is what I would do: // aDoc and anotherDoc are different DocumentImpl objects Node foo = aDoc.removeChild( aDoc.getElementsByTagName("foo").item(0)); Node bar = anotherDoc.getElementsByTagName("bar").item(0); bar.appendChild(foo); When I do this I get the following error: org.apache.xerces.dom.DOMExceptionImpl: DOM005 Wrong document How do I change the owner document for a node? Thanks, Steve --------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: general-unsubscribe@xml.apache.org For additional commands, e-mail: general-help@xml.apache.org