0
的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;) –