Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.XMLOutput.startDocument()


        if ( name == null ) {
            throw new MissingAttributeException( "name" );
        }
        XMLOutput newOutput = createXMLOutput();
        try {
            newOutput.startDocument();
            invokeBody(newOutput);
            newOutput.endDocument();
        }
        finally {
            newOutput.close();
View Full Code Here


        XMLOutput output = new XMLOutput(xmlWriter, xmlWriter);

        String golden = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
        golden += "<html>";

        output.startDocument();
        output.write(golden);
        output.endDocument();
        assertEquals("output should contain the namespaces", golden, writer.toString());
    }
View Full Code Here

        try {
            // we need to avoid multiple start/end document events
            newOutput.setContentHandler(
                new SafeContentHandler(newOutput.getContentHandler())
            );
            newOutput.startDocument();
            invokeBody(newOutput);
            newOutput.endDocument();
        }
        finally {
            try { newOutput.close(); } catch (IOException e) {}
View Full Code Here

        String decl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
        String golden = "<!DOCTYPE foo [\n";
        golden += "  <!ELEMENT foo (#PCDATA)>\n";
        golden += "]><foo></foo>";

        output.startDocument();
        output.write(golden);
        output.endDocument();
        System.err.println("output was: '" + writer.toString() +"'");
        System.err.println("golden is : '" + golden +"'");
        assertEquals("output should contain the CDATA section",
View Full Code Here

        XMLOutput output = new XMLOutput(xmlWriter, xmlWriter);

        String golden = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
        golden += "<html>";

        output.startDocument();
        output.write(golden);
        output.endDocument();
        assertEquals("output should contain the namespaces", golden, writer.toString());
    }
View Full Code Here

        try {
            // we need to avoid multiple start/end document events
            newOutput.setContentHandler(
                new SafeContentHandler(newOutput.getContentHandler())
            );
            newOutput.startDocument();
            invokeBody(newOutput);
            newOutput.endDocument();
        }
        finally {
            try { newOutput.close(); } catch (IOException e) {}
View Full Code Here

        XMLOutput output = new XMLOutput(xmlWriter, xmlWriter);

        String golden = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
        golden += "<html>";

        output.startDocument();
        output.write(golden);
        output.endDocument();
        assertEquals("output should contain the namespaces", golden, writer.toString());
    }
View Full Code Here

        if ( name == null ) {
            throw new MissingAttributeException( "name" );
        }
        XMLOutput newOutput = XMLOutput.createXMLOutput(new FileOutputStream(name));
        try {
            newOutput.startDocument();
            invokeBody(newOutput);
            newOutput.endDocument();
        }
        finally {
            newOutput.close();
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.