I know that one!

Use :

public Document makeDomDocument(Element incomingNode, Document
resultDoc) {
     if (incomingNode != null) {
          Element cloneElement = resultDoc.importNode(incomingNode);
         resultDoc.appendChild(cloneElement);
     }
     return resultDoc;
    }




"Terry Medearis" <[EMAIL PROTECTED]> on 08/08/2001 16:44:29

Please respond to [EMAIL PROTECTED]

To:   <[EMAIL PROTECTED]>
cc:
Subject:  cloneNode and appendChild functions


Greetings,
     I am experiencing problems in cloning an Element node and appending
the
result to a document i.e.:

    public Document makeDomDocument(Element incomingNode, Document
resultDoc) {
     if (incomingNode != null) {
          Element cloneElement = (Element) incomingNode.cloneNode(true);
         resultDoc.appendChild(cloneElement);
     }
     return resultDoc;
    }

On entry to the method, I know that resultDoc is initialized (I've even
tried this same function outside of a separate method and received the same
results).  I get the following error:

"Exception occurred during event dispatching:
org.w3c.dom.DOMException: DOM005 Wrong document
       at
org.apache.xerces.dom.ParentNode.internalInsertBefore(ParentNode.java:389)
       at
org.apache.xerces.dom.ParentNode.insertBefore(ParentNode.java:321)
       at org.apache.xerces.dom.NodeImpl.appendChild(NodeImpl.java:216)"
        .... followed by similar reference points in my source code

I'm using Xerces1.4.0 and JDK 1.3.1.  I've tried looking at the defect list
but found nothing related to this.  Is this a bug in the Xerces code or
have
I messed something up.  Any assistance would be greatly appreciated.

Thanks,

Terry Medearis

Creative Concepts Corporation
[EMAIL PROTECTED]
303-448-0303 x254



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








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

Reply via email to