I cannot figure out why I get a class cast exception when trying to use
the experimental adoptNode method in the Document interface. The
signature of the method is Node adoptNode(Node source). I'm using Xerces
1.4.3.

I am trying to adopt the root element of one document into another
document. The following is the code I am attempting:

                // Document doc, doc2 
                Element doc2root = doc2.getDocumentElement();

                // class cast exception at this line
                Node adoptedRoot = doc.adoptNode(doc2root);

                /* I also tried this instead
                but I still get the same exception */
                // Node adoptedRoot = doc1.adoptNode((Node)doc2Root);
        
                element.appendChild(adoptedRoot);

Thanks for any help or insight you may be able to provide. Wendi
-- 
Wendi Sisson
Systems Programmer
International Trade Development
FedEx Services
(901) 263-6695

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to