读书人

xml解析中的错误

发布时间: 2012-04-04 16:38:51 作者: rapoo

xml解析中的异常

XML code
<connection src = “a" dest ="b" direction="c">        <channel  type="test" /></connection>

Java code
Node child=doc.getElementsByTagName("connection").item(i).getChildNodes().item(0);Element element=(Element)child;


会弹出一个异常
java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredTextImpl cannot be cast to org.w3c.dom.Element

求助解决方法!!

[解决办法]

读书人网 >Java相关

热点推荐