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的根节点是什么