use of com.xpn.xwiki.internal.xml.DOMXMLWriter in project xwiki-platform by xwiki.
the class XWikiDocument method toXMLDocument.
/**
* Serialize the document to an XML {@link DOMDocument}. You should prefer
* {@link #toXML(OutputStream, boolean, boolean, boolean, boolean, XWikiContext)} or
* {@link #toXML(com.xpn.xwiki.internal.xml.XMLWriter, boolean, boolean, boolean, boolean, XWikiContext)} when
* possible to reduce memory load.
*
* @param bWithObjects include XObjects
* @param bWithRendering include the rendered content
* @param bWithAttachmentContent include attachments content
* @param bWithVersions include archived versions
* @param context current XWikiContext
* @return a {@link DOMDocument} containing the serialized document.
* @throws XWikiException when an errors occurs during wiki operations
* @deprecated since 9.0RC1, use {@link #toXML(OutputTarget, boolean, boolean, boolean, boolean, boolean, String)}
* instead
*/
@Deprecated
public Document toXMLDocument(boolean bWithObjects, boolean bWithRendering, boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context) throws XWikiException {
Document doc = new DOMDocument();
DOMXMLWriter wr = new DOMXMLWriter(doc, new OutputFormat("", true, context.getWiki().getEncoding()));
try {
toXML(wr, bWithObjects, bWithRendering, bWithAttachmentContent, bWithVersions, context);
return doc;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations