Package org.jaxen

Examples of org.jaxen.XPath.evaluate()


    }

    public void testEqualsNumberNodeset() throws JaxenException
    {
        XPath xpath = new DOMXPath( "//c = 12" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue(result.booleanValue());
    }

    public void testNotEqualsNumberNodeset() throws JaxenException
    {
View Full Code Here


    }

    public void testNotEqualsNumberNodeset() throws JaxenException
    {
        XPath xpath = new DOMXPath( "//c != 256" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue(result.booleanValue());
    }

    public void testEqualsBooleanNodeset1() throws JaxenException
    {
View Full Code Here

    }

    public void testEqualsBooleanNodeset1() throws JaxenException
    {
        XPath xpath = new DOMXPath( "//c = true()" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue(result.booleanValue());
    }

    public void testEqualsBooleanNodeset2() throws JaxenException
    {
View Full Code Here

    public void testEqualsBooleanNodeset2() throws JaxenException
    {
        //an empty nodeset should be equal to false()
        XPath xpath = new DOMXPath( "//d = false()" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue(result.booleanValue());
    }


    public void testNotEqualsBooleanNodeset1() throws JaxenException
View Full Code Here


    public void testNotEqualsBooleanNodeset1() throws JaxenException
    {
        XPath xpath = new DOMXPath( "//c != false()" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue(result.booleanValue());
    }

    public void testNotEqualsBooleanNodeset2() throws JaxenException
    {
View Full Code Here

    public void testNotEqualsBooleanNodeset2() throws JaxenException
    {
        //an empty nodeset should be not equal to true() 
        XPath xpath = new DOMXPath( "//d != true()" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue(result.booleanValue());
    }

}
View Full Code Here

    }   
   
    public void testNamespaceURIOfEmptyNodeSetIsEmptyString() throws JaxenException
    {
        XPath xpath = new DOMXPath( "namespace-uri(/aaa)" );
        String result = (String) xpath.evaluate(doc);
        assertEquals("", result);
    }   

    public void testNamespaceURIOfProcessingInstructionIsEmptyString() throws JaxenException
    {
View Full Code Here

    public void testNamespaceURIOfProcessingInstructionIsEmptyString() throws JaxenException
    {
        XPath xpath = new DOMXPath( "namespace-uri(/processing-instruction())" );
        ProcessingInstruction pi = doc.createProcessingInstruction("target", "value");
        doc.appendChild(pi);
        String result = (String) xpath.evaluate(doc);
        assertEquals("", result);
    }   

    public void testNamespaceURIOfAttribute() throws JaxenException
    {
View Full Code Here

    public void testNamespaceURIOfAttribute() throws JaxenException
    {
        XPath xpath = new DOMXPath( "namespace-uri(/*/@*)" );
        Attr a = doc.createAttribute("name");
        doc.getDocumentElement().setAttributeNode(a);
        Object result = xpath.evaluate(doc);
        assertEquals("", result);
    }   

    public void testNamespaceURIOfAttributeInNamespace() throws JaxenException
    {
View Full Code Here

    public void testNamespaceURIOfAttributeInNamespace() throws JaxenException
    {
        XPath xpath = new DOMXPath( "namespace-uri(/*/@*)" );
        Attr a = doc.createAttributeNS("http://www.w3.org/", "pre:name");
        doc.getDocumentElement().setAttributeNode(a);
        Object result = xpath.evaluate(doc);
        assertEquals("http://www.w3.org/", result);
    }   

    public void testNamespaceURIOfTextIsEmptyString() throws JaxenException
    {
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.