在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 block
11                 e.printStackTrace();
12             }

 

posted @ 2014-10-08 15:25  asnjudy  阅读(806)  评论(0编辑  收藏  举报