Thank You! Thank You! Thank You! That worked... well, I had to add "true"
as an importNode parameter... i.e.
Node cloneElement = resultDoc.importNode(incomingNode, true);
but otherwise, this seems to have gotten me to the next hurdle.
Thanks,
Terry
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 9:55 AM
To: [EMAIL PROTECTED]
Subject: Re: cloneNode and appendChild functions
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]