📜  如何获取 xpath java 中的所有元素 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:24.145000             🧑  作者: Mango

代码示例1
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());