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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to