Package org.jaxen

Examples of org.jaxen.XPath.selectSingleNode()



    private OMElement getOMElement(String xpathString,
                                   OMElement parentElement) throws JaxenException {
        XPath xpath = getXPath(xpathString);
        return (OMElement) xpath.selectSingleNode(parentElement);
    }

    private XPath getXPath(String xpathString) throws JaxenException {
        SimpleNamespaceContext nsCtx = new SimpleNamespaceContext();
        nsCtx.addNamespace("ns", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.1");
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


    private OMElement getOMElement(String xpathString,
                                   OMElement parentElement) throws JaxenException {
        XPath xpath = getXPath(xpathString);
        return (OMElement) xpath.selectSingleNode(parentElement);
    }

    private XPath getXPath(String xpathString) throws JaxenException {
        SimpleNamespaceContext nsCtx = new SimpleNamespaceContext();
        nsCtx.addNamespace("ns", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.1");
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

     * @return The title of the document, or <code>null</code> if we can't find the title.
     */
    private String getTitle(Document document) throws MojoExecutionException {
        try {
            XPath titleXPath = createTitleXPath();
            Node titleNode = (Node) titleXPath.selectSingleNode(document);
            if (titleNode != null) {
                return titleNode.getNodeValue();
            } else {
                return null;
            }
View Full Code Here

     * @return The title of the document, or <code>null</code> if we can't find the title.
     */
    private String getTitle(Document document) throws MojoExecutionException {
        try {
            XPath titleXPath = createTitleXPath();
            Node titleNode = (Node) titleXPath.selectSingleNode(document);
            if (titleNode != null) {
                return titleNode.getNodeValue();
            } else {
                return null;
            }
View Full Code Here

    Map<String,String> namespaces,
    Map<QName,Function> functions,
    Map<QName,Object> variables) throws XPathException {
    try {
      XPath xpath = getXPath(path, namespaces, functions, variables);
      Object obj = xpath.selectSingleNode(base);
      if (obj instanceof OMAttribute) obj = new FOMAttribute((OMAttribute) obj);
      return obj;
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
View Full Code Here

   *         find the title.
   */
  private String getTitle(Document document) throws MojoExecutionException {
    try {
      XPath titleXPath = createTitleXPath();
      Node titleNode = (Node) titleXPath.selectSingleNode(document);
      if (titleNode != null) {
        return titleNode.getNodeValue();
      } else {
        return null;
      }
View Full Code Here

     *         find the title.
     */
    private String getTitle(Document document) throws MojoExecutionException {
        try {
            XPath titleXPath = createTitleXPath();
            Node titleNode = (Node) titleXPath.selectSingleNode(document);
            if (titleNode != null) {
                return titleNode.getNodeValue();
            } else {
                return null;
            }
View Full Code Here

     *         find the title.
     */
    private String getTitle(Document document) throws MojoExecutionException {
        try {
            XPath titleXPath = createTitleXPath();
            Node titleNode = (Node) titleXPath.selectSingleNode(document);
            if (titleNode != null) {
                return titleNode.getNodeValue();
            } else {
                return 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.