当前位置: 代码迷 >> Java相关 >> xml解析中的错误
  详细解决方案

xml解析中的错误

热度:3598   发布时间:2013-02-25 21:47:10.0
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

求助解决方法!!

------解决方案--------------------------------------------------------
  相关解决方案