第一个问题这句错了
String id = cntAddress.getElementsByTagName("id").item(0).getFirstChild().getNodeValue();
你的xml中<id ref="pjl"/> 没有子结点,so应该是
String id = cntAddress.getElementsByTagName("id").item(0).getNodeValue();
第二个问题你import org.w3c.dom.NamedNodeMap;吗?
String id = cntAddress.getElementsByTagName("id").item(0).getFirstChild().getNodeValue();
你的xml中<id ref="pjl"/> 没有子结点,so应该是
String id = cntAddress.getElementsByTagName("id").item(0).getNodeValue();
第二个问题你import org.w3c.dom.NamedNodeMap;吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货