All Downloads are FREE. Search and download functionalities are using the official Maven repository.

txw2.src.test.IndentingXMLStreamWriterTest Maven / Gradle / Ivy

Go to download

Ehcache is an open source, standards-based cache used to boost performance, offload the database and simplify scalability. Ehcache is robust, proven and full-featured and this has made it the most widely-used Java-based cache.

There is a newer version: 2.10.9.2
Show newest version
import com.sun.xml.txw2.output.IndentingXMLStreamWriter;

import javax.xml.stream.XMLStreamWriter;
import javax.xml.stream.XMLOutputFactory;

/**
 * @author Kohsuke Kawaguchi
 */
public class IndentingXMLStreamWriterTest {
    public static void main(String[] args) throws Exception {
        XMLOutputFactory xof = XMLOutputFactory.newInstance();
        XMLStreamWriter w = new IndentingXMLStreamWriter(xof.createXMLStreamWriter(System.out));

        w.writeStartDocument();
        w.writeStartElement("foo");
        w.writeEmptyElement("bar");
        w.writeStartElement("x");
        w.writeCharacters("body");
        w.writeEndElement();
        w.writeEndElement();
        w.writeEndDocument();

        w.close();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy