Examples of Nodes


Examples of nu.xom.Nodes

   
    public void testNamespaceAxisFromNonElement() {
       
        Text text = new Text("test");
       
        Nodes result = text.query("namespace::*");
        assertEquals(0, result.size());
       
    }
View Full Code Here

Examples of nu.xom.Nodes

        grandchild.addNamespaceDeclaration("pre", "http://www.w3.org/");
        parent.appendChild(child);
        child.appendChild(grandchild);
       
        // Every node has at least a mapping for xml prefix.
        Nodes result = parent.query("self::*[count(namespace::*)=0]");
        assertEquals(0, result.size());  
       
        result = parent.query("self::*[count(namespace::*)=1]");
        assertEquals(1, result.size());  
        assertEquals(parent, result.get(0));
       
        result = child.query("self::*[count(namespace::*)=2]");
        assertEquals(1, result.size());  
        assertEquals(child, result.get(0));
       
        result = grandchild.query("self::*[count(namespace::*)=3]");
        assertEquals(1, result.size());  
        assertEquals(grandchild, result.get(0));
       
    }
View Full Code Here

Examples of nu.xom.Nodes

        grandchild.addNamespaceDeclaration("pre", "http://www.w3.org/");
        parent.appendChild(child);
        child.appendChild(grandchild);
       
        // Every node has at least a mapping for xml prefix.
        Nodes result = parent.query("*[count(namespace::*)=0]");
        assertEquals(0, result.size());  
       
        result = parent.query(".//self::*[count(namespace::*)=1]");
        assertEquals(1, result.size());  
        assertEquals(parent, result.get(0));
       
        result = parent.query(".//*[count(namespace::*)=2]");
        assertEquals(1, result.size());  
        assertEquals(child, result.get(0));
       
        result = parent.query(".//*[count(namespace::*)=3]");
        assertEquals(1, result.size());  
        assertEquals(grandchild, result.get(0));
       
    }
View Full Code Here

Examples of nu.xom.Nodes

        Element parent = new Element("Test", "http://www.example.org");
        Element child = new Element("child", "http://www.example.org");
        parent.appendChild(child);
       
        XPathContext context = new XPathContext("pre", "http://www.example.com");
        Nodes result = parent.query("child::pre:child", context);
        assertEquals(0, result.size());
       
        context.addNamespace("pre", "http://www.example.org");
        result = parent.query("child::pre:child", context);
        assertEquals(1, result.size());
        assertEquals(child, result.get(0));  
       
    }
View Full Code Here

Examples of nu.xom.Nodes

        Element child = new Element("child", "http://www.example.org");
        parent.appendChild(child);
       
        Element test = new Element("pre:test", "http://www.example.org");
        XPathContext context = XPathContext.makeNamespaceContext(test);
        Nodes result = parent.query("child::pre:child", context);
        assertEquals(1, result.size());
        assertEquals(child, result.get(0));  
       
    }
View Full Code Here

Examples of nu.xom.Nodes

        parent.appendChild(child);
       
        Element test = new Element("test");
        test.addAttribute(new Attribute("pre:test", "http://www.example.org", "value"));
        XPathContext context = XPathContext.makeNamespaceContext(test);
        Nodes result = parent.query("child::pre:child", context);
        assertEquals(1, result.size());
        assertEquals(child, result.get(0));  
       
    }
View Full Code Here

Examples of org.apache.jasper.compiler.ELNode.Nodes

            } catch (ELException ele) {
                elException = ele;
            }
        }

        Nodes nodes = null;
        try {
            nodes = ELParser.parse(input, false);
            Assert.assertNull(elException);
        } catch (IllegalArgumentException iae) {
            Assert.assertNotNull(elResult, elException);
            // Not strictly true but enables us to report both
            iae.initCause(elException);
            throw iae;
        }

        TextBuilder textBuilder = new TextBuilder(false);

        nodes.visit(textBuilder);

        Assert.assertEquals(input, textBuilder.getText());
    }
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.