开发者

Executing xpath in android

I want to parse an XML file (execute XPATH)

I use开发者_运维问答d SAX and not JDOM

How can i give item from query

thank you


There is a small example in the javax.xml.xpath package description:

XPath xpath = XPathFactory.newInstance().newXPath();
String expression = "/widgets/widget";
InputSource inputSource = new InputSource("widgets.xml");
NodeSet nodes =
    (NodeSet) xpath.evaluate(expression, inputSource, XPathConstants.NODESET);

If you already have a NodeList then I think you can use a different evaluate method instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜