Examples of booleanValueOf()


Examples of org.apache.axiom.om.xpath.AXIOMXPath.booleanValueOf()

  }
 
  public static boolean evalExpression(OMElement el, String path, String ns)
      throws Exception {
    AXIOMXPath xpathe = formatXPath(path, ns);
    return xpathe.booleanValueOf(el);
  }

  private static AXIOMXPath formatXPath(String path, String ns)
      throws Exception {
    if (!path.startsWith("//")) {
View Full Code Here

Examples of org.dom4j.xpath.DefaultXPath.booleanValueOf()

    public void testBooleanValueOf() throws Exception {
        Document doc = DocumentHelper.parseText("<root><foo>blah</foo></root>");

        XPath path = new DefaultXPath("//root");
        assertTrue(path.booleanValueOf(doc));

        path = new DefaultXPath("//root2");
        assertFalse(path.booleanValueOf(doc));
    }
View Full Code Here

Examples of org.dom4j.xpath.DefaultXPath.booleanValueOf()

        XPath path = new DefaultXPath("//root");
        assertTrue(path.booleanValueOf(doc));

        path = new DefaultXPath("//root2");
        assertFalse(path.booleanValueOf(doc));
    }

    // Implementation methods
    // -------------------------------------------------------------------------
    protected void testXPath(String xpathExpression) {
View Full Code Here

Examples of org.jaxen.BaseXPath.booleanValueOf()

       
        BaseXPath xpath = new DOMXPath("/b/c");
        org.w3c.dom.Element a = doc.createElementNS("", "a");
        doc.appendChild(a);
        List result = xpath.selectNodes(doc);
        assertTrue(! xpath.booleanValueOf(result));
       
    }
   
    public void testAddNamespaceWithNonSimpleNamespaceContext() throws JaxenException {
       
View Full Code Here

Examples of org.jaxen.BaseXPath.booleanValueOf()

       
        BaseXPath xpath = new DOMXPath("/b/c");
        org.w3c.dom.Element a = doc.createElementNS("", "a");
        doc.appendChild(a);
        List result = xpath.selectNodes(doc);
        assertTrue(! xpath.booleanValueOf(result));
       
    }
   
    public void testAddNamespaceWithNonSimpleNamespaceContext() throws JaxenException {
       
View Full Code Here

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

Examples of org.jaxen.XPath.booleanValueOf()

    @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

Examples of org.jaxen.XPath.booleanValueOf()

    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

Examples of org.jaxen.XPath.booleanValueOf()

    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

Examples of org.jaxen.XPath.booleanValueOf()

    /** 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
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.