Package nu.xom

Examples of nu.xom.XPathContext.lookup()


   

    public void testLookupPrefix() {
        XPathContext context = new XPathContext();
        context.addNamespace("foo", "http://www.example.org");
        String url = context.lookup("foo");
        assertEquals("http://www.example.org", url);
    }
   

    public void testLookupNonexistentPrefix() {
View Full Code Here


   

    public void testLookupNonexistentPrefix() {
        XPathContext context = new XPathContext();
        context.addNamespace("foo", "http://www.example.org");
        String url = context.lookup("bar");
        assertNull(url);
    }
   

    public void testParentAxis() {
View Full Code Here

    XSLTransform schematronTransform = Util.buildSchematronTransform(schematronFile);
    Nodes nodes = schematronTransform.transform(new Document(getXOMElementCopy()));
    Document doc = XSLTransform.toDocument(nodes);

    XPathContext context = XPathContext.makeNamespaceContext(doc.getRootElement());
    String svrlNamespace = context.lookup("svrl");
    Nodes outputNodes = doc.query("//svrl:failed-assert | //svrl:successful-report", context);
    for (int i = 0; i < outputNodes.size(); i++) {
      if (outputNodes.get(i) instanceof Element) {
        Element outputElement = (Element) outputNodes.get(i);
        boolean isAssert = "failed-assert".equals(outputElement.getLocalName());
View Full Code Here

   

    public void testLookupPrefix() {
        XPathContext context = new XPathContext();
        context.addNamespace("foo", "http://www.example.org");
        String url = context.lookup("foo");
        assertEquals("http://www.example.org", url);
    }
   

    public void testLookupNonexistentPrefix() {
View Full Code Here

   

    public void testLookupNonexistentPrefix() {
        XPathContext context = new XPathContext();
        context.addNamespace("foo", "http://www.example.org");
        String url = context.lookup("bar");
        assertNull(url);
    }
   

    public void testParentAxis() {
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.