Package org.jaxen.dom

Examples of org.jaxen.dom.DOMXPath.evaluate()


        assertTrue(result.booleanValue());
    }
   
    public void testEqualityAssociativity5B() throws JaxenException {
        XPath xpath = new DOMXPath("2 = 3 = 1 = 4 = 1");
        Boolean result = (Boolean) xpath.evaluate(doc);
        assertFalse(result.booleanValue());
    }
   
    // This is the same test but with parentheses to make explicit
    // how the previous test should be evaluated.
View Full Code Here


   
    // This is the same test but with parentheses to make explicit
    // how the previous test should be evaluated.
    public void testEqualityAssociativity5BP() throws JaxenException {
        XPath xpath = new DOMXPath("(((2 = 3) = 1) = 4) = 1");
        Boolean result = (Boolean) xpath.evaluate(doc);
        assertFalse(result.booleanValue());
    }
   
    public void testMoreComplexArithmeticAssociativity() throws JaxenException {
        XPath xpath = new DOMXPath("1+2+1-1+1");
View Full Code Here

        assertFalse(result.booleanValue());
    }
   
    public void testMoreComplexArithmeticAssociativity() throws JaxenException {
        XPath xpath = new DOMXPath("1+2+1-1+1");
        Double result = (Double) xpath.evaluate(doc);
        assertEquals(4, result.intValue());
    }
   
   
    public void testMostComplexArithmeticAssociativity() throws JaxenException {
View Full Code Here

    }
   
   
    public void testMostComplexArithmeticAssociativity() throws JaxenException {
        XPath xpath = new DOMXPath("1+1+2+1-1+1");
        Double result = (Double) xpath.evaluate(doc);
        assertEquals(5, result.intValue());
    }
   
   
    public void testSimplerArithmeticAssociativity() throws JaxenException {
View Full Code Here

    }
   
   
    public void testSimplerArithmeticAssociativity() throws JaxenException {
        XPath xpath = new DOMXPath("1-1+1");
        Double result = (Double) xpath.evaluate(doc);
        assertEquals(1, result.intValue());
    }
   
   
    public void testNamespaceNodesComeBeforeAttributeNodesInDocumentOrder() throws JaxenException {
View Full Code Here

        doc.appendChild(a);
        Text b = doc.createTextNode("ready");
        a.appendChild(b);
       
        XPath xpath = new DOMXPath("..");
        List result = (List) xpath.evaluate(b);
        assertEquals(1, result.size());
        assertEquals(a, result.get(0));
  
    }
   
View Full Code Here

        Text b = doc.createTextNode("ready");
        a.appendChild(b);
       
        XPath xpath = new DOMXPath("..");
        try {
            xpath.evaluate("String");
            fail("Allowed String as context");
        }
        catch (ClassCastException ex) {
            // success
        }
View Full Code Here

    public void testNaNIsFalse()
      throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("not(0 div 0)");
        Object result = xpath.evaluate(null);
        assertEquals(Boolean.TRUE, result);
       
    }   

    public void testNonEmptyStringIsTrue()
View Full Code Here

    public void testBooleanPrecedence()
     throws JaxenException, ParserConfigurationException {
     
        // Note how the parentheses change the precedence and the result
        DOMXPath xpath1 = new DOMXPath("false() and (false() or true())");
        Boolean result1 = (Boolean) xpath1.evaluate(null);
        assertFalse(result1.booleanValue());
        DOMXPath xpath2 = new DOMXPath("false() and false() or true()");
        Boolean result2 = (Boolean) xpath2.evaluate(null);
        assertTrue(result2.booleanValue());
       
View Full Code Here

        // Note how the parentheses change the precedence and the result
        DOMXPath xpath1 = new DOMXPath("false() and (false() or true())");
        Boolean result1 = (Boolean) xpath1.evaluate(null);
        assertFalse(result1.booleanValue());
        DOMXPath xpath2 = new DOMXPath("false() and false() or true()");
        Boolean result2 = (Boolean) xpath2.evaluate(null);
        assertTrue(result2.booleanValue());
       
        String expr = xpath1.getRootExpr().getText();
        DOMXPath xpath3 = new DOMXPath(expr);
        Boolean result3 = (Boolean) xpath3.evaluate(null);
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.