Package org.jaxen.dom

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


    transHand.setResult(domResult);
    myBuffer.emit(transHand);
    Element returnResult = ((Document)domResult.getNode())
        .getDocumentElement();
    XPath xpath = new DOMXPath("/parent/firstChild");
    String value2 = xpath.stringValueOf(returnResult);
    assertTrue(value2.equals("I'm number one"));


    XPath xpath2 = new DOMXPath("/parent/thirdChild");
    Element child = (Element)xpath2.selectSingleNode(returnResult);
View Full Code Here


//        serializer.transform
//            (new javax.xml.transform.dom.DOMSource(returnResult),
//          streamResult);

    XPath xpath = new DOMXPath("/table/record[1]/painter");
    String value = xpath.stringValueOf(returnResult);
    // check testXSLT.xml for the expected result
    assertTrue(value.equals("Matisse, Henri"));
      }
  }
    }
View Full Code Here

//        serializer.transform
//            (new javax.xml.transform.dom.DOMSource(returnResult),
//          streamResult);

    XPath xpath = new DOMXPath("/table/record[1]/city");
    String value = xpath.stringValueOf(returnResult);
    // check testXSLT.xml for the expected result
    assertTrue(value.equals("Weiterstadt"));
      }
  }
    }
View Full Code Here

//        serializer.transform
//            (new javax.xml.transform.dom.DOMSource(returnResult),
//          streamResult);

    XPath xpath = new DOMXPath("/table/row[1]/@painter");
    String value = xpath.stringValueOf(returnResult);
    // check testXSLT.xml for the expected result
    assertTrue(value.equals("Matisse, Henri"));
      }
  }
    }
View Full Code Here

//        serializer.transform
//            (new javax.xml.transform.dom.DOMSource(returnResult),
//          streamResult);

    XPath xpath = new DOMXPath("/table/record[1]/city");
    String value = xpath.stringValueOf(returnResult);
    // check testXSLT.xml for the expected result
    assertTrue(value.equals("Darmstadt"));
      }
  }
    }
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

     */
    public String valueOf(Node n, String xpath) throws SAXPathException {
  staticInit();
        XPath xp = new DOMXPath(xpath);
        // return xp.valueOf(getLocalContext(n));
        return xp.stringValueOf(getLocalContext(n));
    }

    /** Evaluates an XPath expression to a boolean value. */
    public boolean booleanValueOf(Node n, String xpath)
      throws SAXPathException {
View Full Code Here

                                           testUtilities.javaToJS(xml));
        assertNotNull(xmlResponse);
        Document doc = (Document)xmlResponse.getWrappedNode();
        XPath echoStringPath = new DOMXPath("//t:responseType/text()");
        echoStringPath.addNamespace("t", "http://apache.org/hello_world_xml_http/wrapped/types");
        String nodeText = echoStringPath.stringValueOf(echoStringPath.selectSingleNode(doc));
        assertEquals(nodeText, "Hello \u05e9\u05dc\u05d5\u05dd");
    }
   
    public String getStaticResourceURL() throws Exception {
        File staticFile = new File(this.getClass().getResource("test.html").toURI());
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.