Package nu.xom

Examples of nu.xom.Document.appendChild()


        doc.insertChild(c1, 0);
        grandparent.insertChild(c2, 0);
        parent.insertChild(c3, 0);
        child.insertChild(c4, 0);
        ProcessingInstruction pi = new ProcessingInstruction("appendix", "text");
        doc.appendChild(pi);
        ProcessingInstruction pi2 = new ProcessingInstruction("test", "text");
        parent.appendChild(pi2);
       
        Nodes result = doc.query("descendant::processing-instruction('test')");
        assertEquals(1, result.size());
View Full Code Here


        for (int i = 0; i < rootPosition; i++) {
            result.insertChild(nodes.get(i), i);
        }
       
        for (int i = rootPosition+1; i < nodes.size(); i++) {
            result.appendChild(nodes.get(i));
        }
       
        return result;
       
    }
View Full Code Here

        doc.insertChild(c1, 0);
        grandparent.insertChild(c2, 0);
        parent.insertChild(c3, 0);
        child.insertChild(c4, 0);
        ProcessingInstruction pi = new ProcessingInstruction("appendix", "text");
        doc.appendChild(pi);
        ProcessingInstruction pi2 = new ProcessingInstruction("test", "text");
        parent.appendChild(pi2);
       
        Nodes result = doc.query("descendant::processing-instruction('test')");
        assertEquals(1, result.size());
View Full Code Here

        html.setRootElement((Element) newroot);
        while (input.getChildCount() > 0) {
            Node node = input.getChild(0);
            node.detach();
            if (node instanceof Text) continue;
            html.appendChild(node);
        }   
       
        Nodes doc2Queries = root.query("child::query[starts-with(@id, 'A')]");
       
        XPathContext context = new XPathContext();
View Full Code Here

        Element root = new Element("root");
        root.appendChild("   Lots of random text\n\n\n  ");
        Document doc = new Document(root);
        doc.insertChild(new Comment("some comment data"), 0)
        root.insertChild(new Comment("some comment data"), 0)
        doc.appendChild(new Comment("some comment data"))
        convertAndCompare(doc);
       
    }
   
   
View Full Code Here

   
        Element root = new Element("root");
        Document doc = new Document(root);

        try {
            doc.appendChild(new Text("test"));
            fail("appended string");
        }  
        catch (IllegalAddException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

        catch (IllegalAddException success) {
            assertNotNull(success.getMessage());
        }
       
        try {
            doc.appendChild(new Text("    "));
            fail("appended white space");
        }  
        catch (IllegalAddException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

        catch (IllegalAddException success) {
            assertNotNull(success.getMessage());
        }
       
        try {
            doc.appendChild(new Text("test"));
            fail("appended Text");
        }  
        catch (IllegalAddException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

        catch (IllegalAddException success) {
            assertNotNull(success.getMessage());
        }
       
        try {
            doc.appendChild(new Comment("test"));
            doc.appendChild(new Element("test"));
            fail("appended element");
        }  
        catch (IllegalAddException success) {
            assertNotNull(success.getMessage());
View Full Code Here

            assertNotNull(success.getMessage());
        }
       
        try {
            doc.appendChild(new Comment("test"));
            doc.appendChild(new Element("test"));
            fail("appended element");
        }  
        catch (IllegalAddException success) {
            assertNotNull(success.getMessage());
        }
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.