【发布时间】:2012-11-28 08:06:04
【问题描述】:
xml 位于http://thecybersoft.us/BridalExpo/Getmember.xml
XPathFactory xpathfactory = XPathFactory.newInstance();
XPath xpath = xpathfactory.newXPath();
try {
xpathexpression = xpath.compile("//@[name()='diffgr:id']");//bookstore//book
result = xpathexpression.evaluate(doc,XPathConstants.NODESET);
Log.v(result.toString(), "Value of result");
} catch (XPathExpressionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
在上面的代码中,我按属性获取节点,如何获取各个节点的子节点。还有这个xml的根节点是什么
【问题讨论】:
标签: android xml xml-parsing android-parser