Package nu.xom

Examples of nu.xom.Document.appendChild()


        }  
        catch (WellformednessException success) {
            assertNotNull(success.getMessage());
        }
       
        doc.appendChild(new Comment("test"));
        doc.removeChild(1);
        assertEquals(1, doc.getChildCount());
       
        Comment test = new Comment("test");
        doc.appendChild(test);
View Full Code Here


        doc.appendChild(new Comment("test"));
        doc.removeChild(1);
        assertEquals(1, doc.getChildCount());
       
        Comment test = new Comment("test");
        doc.appendChild(test);
        doc.removeChild(test);
        assertEquals(1, doc.getChildCount());
       
        try {
            Comment something = new Comment("sd");
View Full Code Here

        // root element      
        current = current.getNextSibling();
       
        // epilog
        while (current != null) {
            xomDocument.appendChild(convert(current));
            current = current.getNextSibling();  
        }      
                      
        return xomDocument;
       
View Full Code Here

        Element pdu = new Element("doc");
       
        Document doc = new Document(pdu);
        doc.insertChild(new Comment("comment 1"), 0);
        doc.insertChild(new Comment("comment 2"), 1);
        doc.appendChild(new Comment("comment 3"));
        doc.appendChild(new Comment("comment 4"));
       
        String expected = "<!--comment 1-->\n<!--comment 2-->\n\n<!--comment 3-->\n<!--comment 4-->";
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Canonicalizer canonicalizer = new Canonicalizer(out);
View Full Code Here

       
        Document doc = new Document(pdu);
        doc.insertChild(new Comment("comment 1"), 0);
        doc.insertChild(new Comment("comment 2"), 1);
        doc.appendChild(new Comment("comment 3"));
        doc.appendChild(new Comment("comment 4"));
       
        String expected = "<!--comment 1-->\n<!--comment 2-->\n\n<!--comment 3-->\n<!--comment 4-->";
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Canonicalizer canonicalizer = new Canonicalizer(out);
       
View Full Code Here

        Element pdu = new Element("doc");
       
        Document doc = new Document(pdu);
        doc.insertChild(new ProcessingInstruction("target", "value"), 0);
        doc.insertChild(new Comment("comment 2"), 1);
        doc.appendChild(new Comment("comment 3"));
        doc.appendChild(new ProcessingInstruction("target", "value"));
       
        String expected = "<?target value?>\n<!--comment 2-->\n<doc></doc>\n<!--comment 3-->\n<?target value?>";
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Canonicalizer canonicalizer = new Canonicalizer(out);
View Full Code Here

       
        Document doc = new Document(pdu);
        doc.insertChild(new ProcessingInstruction("target", "value"), 0);
        doc.insertChild(new Comment("comment 2"), 1);
        doc.appendChild(new Comment("comment 3"));
        doc.appendChild(new ProcessingInstruction("target", "value"));
       
        String expected = "<?target value?>\n<!--comment 2-->\n<doc></doc>\n<!--comment 3-->\n<?target value?>";
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Canonicalizer canonicalizer = new Canonicalizer(out);
       
View Full Code Here

                else {
                    xomDocument.insertChild(n, p++);
                }
            }
            else {
                xomDocument.appendChild(n);
            }
        }
       
        org.w3c.dom.Node current = domDocument.getFirstChild();
       
View Full Code Here

       
        // epilog
        while (current != null) {
            Nodes nodes = convert(current, factory);
            for (int i = 0; i < nodes.size(); i++) {
                xomDocument.appendChild(nodes.get(i));
            }
            current = current.getNextSibling();  
        }      
                      
        return xomDocument;
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

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.