xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Chervitz <...@neomorphic.com>
Subject Changing owner document
Date Fri, 12 May 2000 23:56:40 GMT
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

Mime
View raw message