Dear Matt,

> ClassCastException: com.apache.xerces.dom.DeferredTextImpl
> 
> when I try to cast a Node to an Element:
> 
> Element elem = (Element)sourceElem.getFirstChild();
> 
> Now, I have xercesImpl.jar at the front of the classpath so 
> no other class
> copy could be picked up instead.  And I can't seem to get why 
> this is so?
> Is there any other possible package that could cause this?  
> Anyone have any
> thoughts?

My 'any thoughts' are that it is probably not a classloading issue
(unless the issue is that a different Xerces is used), from the
exception I would say that sourceElem is definitely a Xerces node. It's
simply that sourceElem.getFirstChild is a text-node, not an element. Are
you sure sourceElem could not have text-nodes as children (whitespace/
white space between elements can also produce a text node for instance)?

Kind regards,

--Sander.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to