2011-03-28 7 views

Répondre

0

Il est un petit exemple dans la description du paquet javax.xml.xpath:

XPath xpath = XPathFactory.newInstance().newXPath(); 
String expression = "/widgets/widget"; 
InputSource inputSource = new InputSource("widgets.xml"); 
NodeSet nodes = 
    (NodeSet) xpath.evaluate(expression, inputSource, XPathConstants.NODESET); 

I Si vous avez déjà un NodeList alors je pense que vous pouvez utiliser un different evaluate method à la place.

Questions connexes