Examples of DOMXPath


Examples of org.jaxen.dom.DOMXPath

//         (javax.xml.transform.OutputKeys.INDENT,"yes");
//        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

Examples of org.jaxen.dom.DOMXPath

//         (javax.xml.transform.OutputKeys.INDENT,"yes");
//        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

Examples of org.jaxen.dom.DOMXPath

    transHand.setResult(domResult);
    myBuffer.emit(transHand);
    Element returnResult = ((Document)domResult.getNode())
        .getDocumentElement();

    XPath xpath1 = new DOMXPath("/painters/table[1]/row[1]");
    Element painter1
        = (Element)xpath1.selectSingleNode(returnResult);
    String value1 = painter1.getAttribute("painter");
    // check testXSLT.xml for the expected result
    assertTrue(value1.equals("Matisse, Henri"));

    XPath xpath2 = new DOMXPath("/painters/table[2]/row[2]");
    Element painter2
        = (Element)xpath2.selectSingleNode(returnResult);
    String value2 = painter2.getAttribute("painter");
    // check testXSLT.xml for the expected result
    assertTrue(value2.equals("Monet, Claude"));
      }
  }
View Full Code Here

Examples of org.jaxen.dom.DOMXPath

    transHand.setResult(domResult);
    myBuffer.emit(transHand);
    Element returnResult = ((Document)domResult.getNode())
        .getDocumentElement();

    XPath xpath = new DOMXPath("/painters/table[3]/row[3]");
    Element painter
        = (Element)xpath.selectSingleNode(returnResult);
    String value = painter.getAttribute("title");
    // check testXSLT.xml for the expected result
    assertTrue(value.equals("Poplars along the River Epte, Autumn"));
      }
  }
View Full Code Here

Examples of org.jaxen.dom.DOMXPath

//          (javax.xml.transform.OutputKeys.INDENT,"yes");
//         serializer.transform
//             (new javax.xml.transform.dom.DOMSource(returnResult),
//           streamResult);

    XPath xpath = new DOMXPath("/row");
    Element painter
        = (Element)xpath.selectSingleNode(returnResult);
    String value = painter.getAttribute("title");
    // check testXSLT.xml for the expected result
    assertTrue(value.equals("La Musique"));
      }
  }
View Full Code Here

Examples of org.jaxen.dom.DOMXPath

        return accept;
    }

    protected DOMXPath getDOMXPath() throws JaxenException
    {
        DOMXPath xpath = new DOMXPath(pattern);
        setupNamespaces(xpath);
        return xpath;
    }
View Full Code Here

Examples of org.jaxen.dom.DOMXPath

    protected XPath createXPath(String expression, Object object) throws JaxenException
    {
        if(object instanceof Document || object instanceof Element)
        {
            return new DOMXPath(expression);
        }
        else if (object instanceof org.dom4j.Document || object instanceof org.dom4j.Element)
        {
            return new Dom4jXPath(expression);
        }
View Full Code Here

Examples of org.jaxen.dom.DOMXPath

    private Object assertCountXPath2(int expectedSize, Object context, String xpathStr) throws JaxenException
    {
        log(debug,
                "  Select :: " + xpathStr);
        DOMXPath xpath = new DOMXPath(xpathStr);
        List results = xpath.selectNodes(getContext(context));
        log(debug,
                "    Expected Size :: " + expectedSize);
        log(debug,
                "    Result Size   :: " + results.size());
        if (expectedSize != results.size())
        {
            log(debug,
                    "      ## FAILED");
            log(debug,
                    "      ## xpath: " + xpath + " = " + xpath.debug());
            Iterator resultIter = results.iterator();
            while (resultIter.hasNext())
            {
                log(debug,
                        "      --> " + resultIter.next());
View Full Code Here

Examples of org.jaxen.dom.DOMXPath

    {
        try
        {
            log(debug,
                    "  Select :: " + xpathStr);
            DOMXPath xpath = new DOMXPath(xpathStr);
            List results = xpath.selectNodes(getContext(context));
            log(debug,
                    "    Result Size   :: " + results.size());
            fail("An exception was expected.");
        }
        catch (JaxenException e)
View Full Code Here

Examples of org.jaxen.dom.DOMXPath

        }
    }

    private void assertValueOfXPath(String expected, Object context, String xpathStr) throws JaxenException
    {
            DOMXPath xpath = new DOMXPath(xpathStr);
            Object node = xpath.evaluate(getContext(context));
            String result = StringFunction.evaluate(node,
                    getNavigator());
            log(debug,
                    "  Select :: " + xpathStr);
            log(debug,
                    "    Expected :: " + expected);
            log(debug,
                    "    Result   :: " + result);
            if (!expected.equals(result))
            {
                log(debug,
                        "      ## FAILED");
                log(debug,
                        "      ## xpath: " + xpath + " = " + xpath.debug());
            }
            assertEquals(xpathStr,
                    expected,
                    result);
            assertExprGetTextIdempotent(xpath);
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.