You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Terry Medearis <tm...@creativecorp.com> on 2001/08/08 17:44:29 UTC

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
tmedearis@creativecorp.com
303-448-0303 x254



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org