Package nu.xom

Examples of nu.xom.ProcessingInstruction


    public void testToDocumentWithText() {
    
        Nodes input = new Nodes();
        Element root = new Element("root");
        Comment comment = new Comment("data");
        ProcessingInstruction pi = new ProcessingInstruction("target", "data");
        input.append(comment);
        input.append(root);
        input.append(pi);
        input.append(new Text("text"));
        try {
View Full Code Here


    public void testToDocumentWithAttribute() {
    
        Nodes input = new Nodes();
        Element root = new Element("root");
        Comment comment = new Comment("data");
        ProcessingInstruction pi = new ProcessingInstruction("target", "data");
        input.append(comment);
        input.append(root);
        input.append(pi);
        input.append(new Attribute("name", "text"));
        try {
View Full Code Here

    
        Nodes input = new Nodes();
        Element root = new Element("root");
        DocType doctype = new DocType("root");
        Comment comment = new Comment("data");
        ProcessingInstruction pi = new ProcessingInstruction("target", "data");
        input.append(comment);
        input.append(doctype);
        input.append(root);
        input.append(pi);
        Document output = XSLTransform.toDocument(input);
View Full Code Here

    
        Nodes input = new Nodes();
        Element root = new Element("root");
        DocType doctype = new DocType("root");
        Comment comment = new Comment("data");
        ProcessingInstruction pi = new ProcessingInstruction("target", "data");
        input.append(comment);
        input.append(root);
        input.append(doctype);
        input.append(pi);
        try {
View Full Code Here

    public void testToDocumentWithPrologAndEpilog() {
    
        Nodes input = new Nodes();
        Element root = new Element("root");
        Comment comment = new Comment("data");
        ProcessingInstruction pi = new ProcessingInstruction("target", "data");
        input.append(comment);
        input.append(root);
        input.append(pi);
        Document output = XSLTransform.toDocument(input);
        assertEquals(root, output.getRootElement());
View Full Code Here

   
    public void testProcessingInstruction()
      throws IOException, SAXException, ParsingException {
       
        Document doc = new Document(new Element("a"));
        doc.insertChild(new ProcessingInstruction(
          "xml-stylesheet", "type=\"application/xml\" href=\"stylesheet.xsl\""), 0)
        convertAndCompare(doc);
       
    }
View Full Code Here

           
            public Nodes finishMakingElement(Element element) {
                Nodes result = new Nodes();
                result.append(new Comment("test"));
                result.append(new Element("newroot"));
                result.append(new ProcessingInstruction("test", "test"));
                return result;  
            }
           
        });
        Document doc = builder.build(data, "http://www.example.org/");
View Full Code Here

           
            public Nodes finishMakingElement(Element element) {
                Nodes result = new Nodes();
                result.append(new Comment("test"));
                result.append(element);
                result.append(new ProcessingInstruction("test", "test"));
                return result;  
            }
           
        });
        Document doc = builder.build(data, "http://www.example.org/");
View Full Code Here

        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes finishMakingElement(Element element) {
                Nodes result = new Nodes();
                result.append(new Comment("test"));
                result.append(new ProcessingInstruction("test", "test"));
                return result;  
            }
           
        });
        try {
View Full Code Here

    public void testCanonicalizePrologAndEpilog() throws IOException {
       
        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

TOP

Related Classes of nu.xom.ProcessingInstruction

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.