首页 > 代码库 > 在Element节点上进行Xpath

在Element节点上进行Xpath

 1        XPathFactory xPathFactory = XPathFactory.newInstance(); 2             XPath xpath = xPathFactory.newXPath(); 3  4             try { 5                 String rdfID = xpath.evaluate("/validateResponse/id", respValtElement); 6                 String rdfResult = xpath.evaluate("/validateResponse/content", respValtElement); 7          8                 System.out.println("校验结果:" + rdfResult); 9             } catch (XPathExpressionException e) {10                 // TODO Auto-generated catch block11                 e.printStackTrace();12             }

 

在Element节点上进行Xpath