Example usage for org.jdom2.output XMLOutputter XMLOutputter

List of usage examples for org.jdom2.output XMLOutputter XMLOutputter

Introduction

In this page you can find the example usage for org.jdom2.output XMLOutputter XMLOutputter.

Prototype

public XMLOutputter(Format format, XMLOutputProcessor processor) 

Source Link

Document

This will create an XMLOutputter with the specified format characteristics.

Usage

From source file:jodtemplate.util.JDOMHelper.java

License:Apache License

public String getRawContents(final Document dom) throws IOException {
    final Format format = Format.getRawFormat();
    format.setLineSeparator(LineSeparator.UNIX);
    final XMLOutputter outputter = new XMLOutputter(format, new StandaloneOutputProcessor());
    final Writer writer = new StringWriter();
    outputter.output(dom, writer);/*w  w  w.ja v  a 2 s . c o m*/
    return writer.toString();
}

From source file:jodtemplate.util.JDOMHelper.java

License:Apache License

public void write(final Document dom, final OutputStream stream) throws IOException {
    final Format format = Format.getRawFormat();
    format.setLineSeparator(LineSeparator.UNIX);
    final XMLOutputter outputter = new XMLOutputter(format, new StandaloneOutputProcessor());
    outputter.output(dom, stream);//from w w  w  .ja v  a  2s .co  m
}