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 Bob Yu <ja...@home.com> on 2001/09/21 18:28:23 UTC
problem: import exception
Hi there,
Anyone can help me on this problem?
In my code I have:
protected void pasteNode(Node thisNode, Node copyNode) {
....
Document doc = thisNode.getOwnerDocument();
Node nodeToInsert = doc.importNode(copyNode, true);
thisNode.appendChild(nodeToInsert);
....
}
where "thisNode" and "copyNode" are existing object instances.
I got exceptions:
java.lang.ClassCastException: org.apache.xerces.dom.AttrImpl
at
org.apache.xerces.dom.NodeImpl.dispatchEventToSubtree(NodeImpl.java:1030)
at
org.apache.xerces.dom.ChildAndParentNode.internalInsertBefore(ChildAndParent
Node.java:518)
at
org.apache.xerces.dom.ChildAndParentNode.insertBefore(ChildAndParentNode.jav
a:322)
at org.apache.xerces.dom.NodeImpl.appendChild(NodeImpl.java:214)
at com.sni.ui.SniTableTreeModel.pasteNode(SniTableTreeModel.java:128)
....
Please, please tell me where is wrong? Or, why the .ClassCastException
occured?
Thanks.
-Bob
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org