Mr. Garbuzov, a question first.
What is your nodeContainer variable? I know that it is a class that extends abstract class NodeContainer but which one: DocumentImpl, ElementImpl,etc.


I am not able to reproduce your problem with the information that you
provided.

A ClassCastException is a runtime exception thrown when a program
attemts to cas an instance of a class to another and that cast is
not allowed.

The reason for this exception when deep=true is that
we are going through a different code branch ( righ! this is obvious).

I am using the latest source for DocumentImpl and I could not
match your lines so you must be using an older version.

If you can indicate what is on line 678 of DocumentImpl in your source base that is where this cast occurs. It also will help to know the class of the nodeContainer variable.

Thanks,
          Jeffrey Rodriguez
          XML Development
          IBM Cupertino


From: Boris Garbuzov <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: clone
Date: Tue, 28 Mar 2000 08:57:35 -0800

Can somebody explain the problem? The following code

deep = true;
Node node = nodeContainer.cloneNode (deep);

fails the following way

java.lang.ClassCastException: org.apache.xerces.dom.TextImpl
at org.apache.xerces.dom.DocumentImpl.importNode(DocumentImpl.java:678)
at org.apache.xerces.dom.DocumentImpl.importNode(DocumentImpl.java:791)
at org.apache.xerces.dom.DocumentImpl.cloneNode(DocumentImpl.java:226)
at com.keystrokenet.loanproduct.xml.test.Lab.executeTestBody(Lab.java:597)


but succedes for deep = false.

--
Boris Garbuzov.
Mailing address:
Box 715, Seattle, Washington, 98111-0715, USA.
E-mail: [EMAIL PROTECTED], [EMAIL PROTECTED]
Telephone: 1(206)781-5165 (home), 1(206)576-4549 (office).
Resedential address: 139 NW 104 Street, Seattle, 98177, Wa, USA



______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com



Reply via email to