Package nu.xom

Examples of nu.xom.Element.appendChild()


        child2.appendChild("2");
        child2.addAttribute(new Attribute("xml:lang",
          "http://www.w3.org/XML/1998/namespace", "fr"));
        parent.appendChild(child2);
        Element child3 = new Element("child");
        child3.appendChild("3");
        parent.appendChild(child3);
        Element child4 = new Element("child");
        child4.appendChild("4");
        child4.addAttribute(new Attribute("xml:lang",
          "http://www.w3.org/XML/1998/namespace", "en-US"));
View Full Code Here


        parent.appendChild(child2);
        Element child3 = new Element("child");
        child3.appendChild("3");
        parent.appendChild(child3);
        Element child4 = new Element("child");
        child4.appendChild("4");
        child4.addAttribute(new Attribute("xml:lang",
          "http://www.w3.org/XML/1998/namespace", "en-US"));
        parent.appendChild(child4);
       
        Nodes result = parent.query("child::*/@xml:lang");
 
View Full Code Here

       
        Element grandparent = new Element("Test");
        Document doc = new Document(grandparent);
        Element parent = new Element("Test");
        Element child1 = new Element("child");
        child1.appendChild("foo");
        Element child2 = new Element("child");
        child2.appendChild("bar");
        parent.appendChild(child1);
        parent.appendChild(child2);
        grandparent.appendChild(parent);
View Full Code Here

        Document doc = new Document(grandparent);
        Element parent = new Element("Test");
        Element child1 = new Element("child");
        child1.appendChild("foo");
        Element child2 = new Element("child");
        child2.appendChild("bar");
        parent.appendChild(child1);
        parent.appendChild(child2);
        grandparent.appendChild(parent);
       
        Nodes result = doc.query("descendant::*[.='foo']");
 
View Full Code Here

       
        Element grandparent = new Element("Test");
        Document doc = new Document(grandparent);
        Element parent = new Element("Test");
        Element child1 = new Element("child");
        child1.appendChild("foo");
        Element child2 = new Element("child");
        child2.appendChild("bar");
        parent.appendChild(child1);
        parent.appendChild(child2);
        grandparent.appendChild(parent);
View Full Code Here

        Document doc = new Document(grandparent);
        Element parent = new Element("Test");
        Element child1 = new Element("child");
        child1.appendChild("foo");
        Element child2 = new Element("child");
        child2.appendChild("bar");
        parent.appendChild(child1);
        parent.appendChild(child2);
        grandparent.appendChild(parent);
       
        Nodes result = doc.query("/Test/Test/*[12]");
 
View Full Code Here

    public void testSelfAxisWithTextChild() {
       
        Element parent = new Element("parent");
        Node child = new Text("child");
        parent.appendChild(child);
        Nodes result = child.query("self::text()");
        assertEquals(1, result.size());
        assertEquals(child, result.get(0));
       
    }
View Full Code Here

        Element parent = new Element("parent");
        Node child1 = new Text("1");
        Node child2 = new Text("2");
        Node child3 = new Text("3");
        Node child4 = new Text("4");
        parent.appendChild(child1);
        parent.appendChild(child2);
        parent.appendChild(child3);
        parent.appendChild(child4);
        Nodes result = child1.query("self::text()");
        assertEquals(4, result.size());
View Full Code Here

        Node child1 = new Text("1");
        Node child2 = new Text("2");
        Node child3 = new Text("3");
        Node child4 = new Text("4");
        parent.appendChild(child1);
        parent.appendChild(child2);
        parent.appendChild(child3);
        parent.appendChild(child4);
        Nodes result = child1.query("self::text()");
        assertEquals(4, result.size());
        assertEquals(child1, result.get(0));
View Full Code Here

        Node child2 = new Text("2");
        Node child3 = new Text("3");
        Node child4 = new Text("4");
        parent.appendChild(child1);
        parent.appendChild(child2);
        parent.appendChild(child3);
        parent.appendChild(child4);
        Nodes result = child1.query("self::text()");
        assertEquals(4, result.size());
        assertEquals(child1, result.get(0));
        assertEquals(child2, result.get(1));
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.