Package nu.xom

Examples of nu.xom.Comment


        return new Text(text.getValue());
    }

   
    private Node copy(Comment comment) {
        return new Comment(comment.getValue());
    }
View Full Code Here


    doc = new Document(root);
    doc.setBaseURI(base1);
    Element child = new Element("child");
    root.appendChild(child);
    child.setBaseURI(base2);
    child.appendChild(new Comment("here I am"));
   
    Element child2 = new Element("child2");
    root.appendChild(child2);
    Element child3 = new Element("child3");
View Full Code Here

        return new Text(text.getValue());
    }

   
    private Node copy(Comment comment) {
        return new Comment(comment.getValue());
    }
View Full Code Here

      Document doc = new Document(root);
      doc.insertChild(svgDOCTYPE, 0);
      ProcessingInstruction xmlstylesheet = new ProcessingInstruction("xml-stylesheet",
       "type=\"text/css\" href=\"standard.css\"");
      doc.insertChild(xmlstylesheet, 0);
      Comment comment = new Comment(
       "An example from Chapter 10 of Processing XML with Java");
      doc.insertChild(comment, doc.indexOf(root));
      Element desc = new Element("desc", "http://www.w3.org/2000/svg");
      root.appendChild(desc);
      Text descText = new Text("An example from Processing XML with Java");
View Full Code Here

   
    public void testIndexOf() {
       
        Element child1 = new Element("old1");
        Text child2 = new Text("old2");
        Comment child3 = new Comment("old3");
       
        assertEquals(-1, empty.indexOf(child1));       
       
        empty.appendChild(child1);
        empty.appendChild(child2);
View Full Code Here

    
        Element root = new Element("root");
        Document doc = new Document(root);
        DocType doctype = new DocType("root");
        doc.setDocType(doctype);
        Comment c = new Comment("test");
        doc.insertChild(c, 0);
       
        Nodes result = doc.query("child::node()[1]");
        assertEquals(1, result.size());
        assertEquals(c, result.get(0));
View Full Code Here

        Element parent = new Element("Test");
        Element child = new Element("child");
        parent.appendChild(child);
        grandparent.appendChild(parent);
       
        Comment c1 = new Comment("c1");
        Comment c2 = new Comment("c2");
        Comment c3 = new Comment("c3");
        Comment c4 = new Comment("c4");
       
        doc.insertChild(c1, 0);
        grandparent.insertChild(c2, 0);
        parent.insertChild(c3, 0);
        child.insertChild(c4, 0);
View Full Code Here

        Element parent = new Element("Test");
        Element child = new Element("child");
        parent.appendChild(child);
        grandparent.appendChild(parent);
       
        Comment c1 = new Comment("c1");
        Comment c2 = new Comment("c2");
        Comment c3 = new Comment("c3");
        Comment c4 = new Comment("c4");
       
        doc.insertChild(c1, 0);
        grandparent.insertChild(c2, 0);
        parent.insertChild(c3, 0);
        child.insertChild(c4, 0);
View Full Code Here

        Element parent = new Element("Test");
        Element child = new Element("child");
        parent.appendChild(child);
        grandparent.appendChild(parent);
       
        Comment c1 = new Comment("c1");
        Comment c2 = new Comment("c2");
        Comment c3 = new Comment("c3");
        Comment c4 = new Comment("c4");
       
        doc.insertChild(c1, 0);
        grandparent.insertChild(c2, 0);
        parent.insertChild(c3, 0);
        child.insertChild(c4, 0);
View Full Code Here

        Nodes output = xform.transform(input);
        assertEquals(6, output.size());
        assertEquals(element1, output.get(0));
        assertEquals(element2, output.get(1));
        assertEquals(new Element("element4"), output.get(3));
        assertEquals(new Comment("test"), output.get(4));
        assertEquals(new ProcessingInstruction("test",
          "PIs are not treated as literals in XSLT?"), output.get(5));
       
    }
View Full Code Here

TOP

Related Classes of nu.xom.Comment

Copyright © 2018 www.massapicom. 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.