📅  最后修改于: 2022-03-11 14:48:24.145000             🧑  作者: Mango
XPathExpression expr = xpath.compile("//Yourpath");
NodeList list= (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i);
System.out.println(node.getTextContent());