List of usage examples for org.jdom2.output XMLOutputter XMLOutputter
public XMLOutputter(Format format, XMLOutputProcessor processor)
XMLOutputter with the specified format characteristics. 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 }