Package org.jaxen

Examples of org.jaxen.XPath.booleanValueOf()


    Map<QName,Function> functions,
    Map<QName,Object> variables)
      throws XPathException {
    try {
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.booleanValueOf(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
 
View Full Code Here


    @Override
    public boolean evaluateAsBoolean(String expression, Source context) throws XPathException {
        try {
            XPath xpath = createXPath(expression);
            Element element = getRootElement(context);
            return xpath.booleanValueOf(element);
        }
        catch (JaxenException ex) {
            throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex);
        }
        catch (TransformerException ex) {
View Full Code Here

    Map<QName,Object> variables)
      throws XPathException {
    try {
      base = getElementWrapped(base);
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.booleanValueOf(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
 
View Full Code Here

    Map<QName,Object> variables)
      throws XPathException {
    try {
      base = getElementWrapped(base);
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.booleanValueOf(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
 
View Full Code Here

    /** Evaluates an XPath expression to a boolean value. */
    public boolean booleanValueOf(Node n, String xpath)
      throws SAXPathException {
  staticInit();
  XPath xp = parse(xpath);
  return xp.booleanValueOf(getLocalContext(n));
    }

    /** Evalutes an XPath expression to a List of nodes. */
    public List selectNodes(Node n, String xpath) throws SAXPathException {
  staticInit();
View Full Code Here

                                  Map<QName, Function> functions,
                                  Map<QName, Object> variables) throws XPathException {
        try {
            base = getElementWrapped(base);
            XPath xpath = getXPath(path, namespaces, functions, variables);
            return xpath.booleanValueOf(base);
        } catch (JaxenException e) {
            throw new XPathException(e);
        }
    }
View Full Code Here

    Map<QName,Function> functions,
    Map<QName,Object> variables)
      throws XPathException {
    try {
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.booleanValueOf(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
 
View Full Code Here

    Map<QName,Function> functions,
    Map<QName,Object> variables)
      throws XPathException {
    try {
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.booleanValueOf(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
 
View Full Code Here

            SAXReader reader = new SAXReader();

            Document doc = reader.read( "xml/simple.xml" );

            boolean answer = xpath.booleanValueOf( doc );

            assertTrue( "Xpath worked: " + xpath, answer );

            xpath = new Dom4jXPath( "'a' = 'b'" );
           
View Full Code Here

            assertTrue( "Xpath worked: " + xpath, answer );

            xpath = new Dom4jXPath( "'a' = 'b'" );
           
            answer = xpath.booleanValueOf( doc );

            assertTrue( "XPath should return false: " + xpath, ! answer );

        }
        catch (Exception e)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.