Package org.jaxen

Examples of org.jaxen.XPath.stringValueOf()


    Map<QName,Object> variables)
      throws XPathException {
    try {
      base = getElementWrapped(base);
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.stringValueOf(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
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

                          Map<QName, Function> functions,
                          Map<QName, Object> variables) throws XPathException {
        try {
            base = getElementWrapped(base);
            XPath xpath = getXPath(path, namespaces, functions, variables);
            return xpath.stringValueOf(base);
        } catch (JaxenException e) {
            throw new XPathException(e);
        }
    }
View Full Code Here

    Map<QName,Function> functions,
    Map<QName,Object> variables)
      throws XPathException {
    try {
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.stringValueOf(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
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

        else
            fail("Document type "+document.getClass().getName());

        xpath.setNamespaceContext(new SimpleNamespaceContext(namespaces));

        return xpath.stringValueOf(document);
    }

    /**
     * Add a namespace mapping for XPath expressions.
     */
 
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("Hello \u05e9\u05dc\u05d5\u05dd", nodeText);
    }
   
    public String getStaticResourceURL() throws Exception {
        File staticFile = new File(this.getClass().getResource("test.html").toURI());
View Full Code Here

            fail("Document type " + this.document.getClass().getName());
        }

        xpath.setNamespaceContext(new SimpleNamespaceContext(this.namespaces));

        return xpath.stringValueOf(this.document);
    }

    /**
     * Add a namespace mapping for XPath expressions.
     */
 
View Full Code Here

        else
            fail("Document type "+document.getClass().getName());

        xpath.setNamespaceContext(new SimpleNamespaceContext(namespaces));

        return xpath.stringValueOf(document);
    }

    /**
     * Add a namespace mapping for XPath expressions.
     */
 
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.