我正在尝试解析此回复 成功 twss_3ea30fcc6c5b34e
我这样做了但失败了;
//parse response
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
org.w3c.dom.Document document = builder.parse(new InputSource(new StringReader(response)));
XPath xpath = XPathFactory.newInstance().newXPath();
XPathExpression expr =
xpath.compile("//o/s/*/text()");
Object result = expr.evaluate(document, XPathConstants.NODESET);
//for loop for expr
NodeList nodes = (NodeList) result;
for (int i = 0; i < nodes.getLength(); i++) {
System.out.println(nodes.item(i).getNodeValue());
}
如何获取状态和事务I的值?