use of org.dom4j.io.XMLWriter in project zm-mailbox by Zimbra.
the class DavResource method getPropertiesAsText.
protected String getPropertiesAsText(DavContext ctxt) throws IOException {
Element e = org.dom4j.DocumentHelper.createElement(DavElements.E_PROP);
for (ResourceProperty rp : mProps.values()) rp.toElement(ctxt, e, false);
OutputFormat format = OutputFormat.createPrettyPrint();
format.setTrimText(false);
format.setOmitEncoding(false);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLWriter writer = new XMLWriter(baos, format);
writer.write(e);
return new String(baos.toByteArray());
}
use of org.dom4j.io.XMLWriter in project zm-mailbox by Zimbra.
the class DomUtil method writeDocumentToStream.
public static void writeDocumentToStream(Document doc, OutputStream out) throws IOException {
OutputFormat format = OutputFormat.createPrettyPrint();
format.setTrimText(false);
format.setOmitEncoding(false);
XMLWriter writer = new XMLWriter(out, format);
writer.write(doc);
}
Aggregations