Package org.dom4j.io

Examples of org.dom4j.io.HTMLWriter$FormatState


    public void testBug923882asWriterWithEmptyCharArray() throws Exception {
        // use an the HTMLWriter sax-methods.
        //
        StringWriter buffer = new StringWriter();
        HTMLWriter writer = new HTMLWriter(buffer, OutputFormat
                .createPrettyPrint());
        writer.characters("wor".toCharArray(), 0, 3);
        writer.characters(new char[0], 0, 0);
        writer.characters("d-being-cut".toCharArray(), 0, 11);

        String expected = "word-being-cut";
        assertEquals(expected, buffer.toString());
    }
View Full Code Here


    public void testBug619415() throws Exception {
        Document doc = getDocument("/xml/test/dosLineFeeds.xml");

        StringWriter wr = new StringWriter();
        HTMLWriter writer = new HTMLWriter(wr, new OutputFormat("", false));
        writer.write(doc);

        String result = wr.toString();
        System.out.println(result);

        assertTrue(result.indexOf("Mary had a little lamb.") > -1);
View Full Code Here

    /**
     * A Factory Method to create an <code>XMLWriter</code> instance allowing
     * derived classes to change this behaviour
     */
    protected XMLWriter createXMLWriter() throws Exception {
        return new HTMLWriter(System.out);
    }
View Full Code Here

            StringWriter writer = new StringWriter(DEFAULT_ELEMENT_STRINGIFYING_BUFFER_SIZE);
            XMLWriter xmlWriter = null;
           
            try
            {
                xmlWriter = new HTMLWriter(writer, DEFAULT_HTML_OUTPUT_FORMAT);
                xmlWriter.write(element);
                xmlWriter.flush();
                xmlWriter.close();
                html = writer.toString();
            }
View Full Code Here

TOP

Related Classes of org.dom4j.io.HTMLWriter$FormatState

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.