Code example for XPathExpression

Methods: evaluate

0
    } 
 
    private Object get(XPathExpression expr, QName resultType) {
        Object result = null;
        try { 
            result = expr.evaluate(document, resultType);
        } catch (Throwable t) {
        	throw new IllegalStateException("Xpath can not evaluate.");
        } 
        return result;
    } 
     
    public Node getNode(String expression) {
        return (Node) get(expression, XPathConstants.NODE);
    } 
 
	@SuppressWarnings("unused") 
	private Node getNode(XPathExpression expr) {
        return (Node) get(expr, XPathConstants.NODE);
    }