Package org.jaxen

Examples of org.jaxen.BaseXPath.stringValueOf()


   
    public void testSelectSingleNodeForContext() throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("1 + 2");
       
        String stringValue = xpath.stringValueOf(xpath);
        assertEquals("3", stringValue);
       
        Number numberValue = xpath.numberValueOf(xpath);
        assertEquals(3, numberValue.doubleValue(), 0.00001);
       
View Full Code Here


    public void testValueOfEmptyListIsEmptyString() throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("/element");
        doc.appendChild(doc.createElement("root"));
       
        String stringValue = xpath.stringValueOf(doc);
        assertEquals("", stringValue);
       
    }

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

       
        BaseXPath xpath = new DOMXPath("//. | /");
        org.w3c.dom.Element root = doc.createElementNS("http://www.example.org/", "root");
        doc.appendChild(root);
       
        String stringValue = xpath.stringValueOf(doc);
        assertEquals("", stringValue);
       
    }

   
View Full Code Here

   
    public void testSelectSingleNodeForContext() throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("1 + 2");
       
        String stringValue = xpath.stringValueOf(xpath);
        assertEquals("3", stringValue);
       
        Number numberValue = xpath.numberValueOf(xpath);
        assertEquals(3, numberValue.doubleValue(), 0.00001);
       
View Full Code Here

    public void testValueOfEmptyListIsEmptyString() throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("/element");
        doc.appendChild(doc.createElement("root"));
       
        String stringValue = xpath.stringValueOf(doc);
        assertEquals("", stringValue);
       
    }

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

       
        BaseXPath xpath = new DOMXPath("//. | /");
        org.w3c.dom.Element root = doc.createElementNS("http://www.example.org/", "root");
        doc.appendChild(root);
       
        String stringValue = xpath.stringValueOf(doc);
        assertEquals("", stringValue);
       
    }

   
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.