Code example for XPath

Methods: evaluate

0
      throws XPathExpressionException, ResourceLoadingException, IOException 
  { 
    final InputStream stream = xmlResourceData.getResourceAsStream(resourceManager);
    try 
    { 
      return (NodeList) xpath.evaluate(xpathQuery, new InputSource(stream), XPathConstants.NODESET);
    } 
    finally 
    { 
      stream.close();
    } 
  } 
 
  private Node evaluateNode(final XPath xpath, final String xpathQuery,
                            final ResourceData xmlResourceData, final ResourceManager resourceManager)
      throws XPathExpressionException, ResourceLoadingException, IOException 
  { 
    final InputStream stream = xmlResourceData.getResourceAsStream(resourceManager);
    try 
    { 
      return (Node) xpath.evaluate(xpathQuery, new InputSource(stream), XPathConstants.NODE);