Search in sources :

Example 1 with XMLWriter

use of com.xpn.xwiki.internal.xml.XMLWriter in project xwiki-platform by xwiki.

the class Package method toXML.

/**
 * Write the package.xml file to an OutputStream
 *
 * @param out the OutputStream to write to
 * @param context curent XWikiContext
 * @throws IOException when an error occurs during streaming operation
 * @since 2.3M2
 */
public void toXML(OutputStream out, XWikiContext context) throws IOException {
    XMLWriter wr = new XMLWriter(out, new OutputFormat("", true, context.getWiki().getEncoding()));
    Document doc = new DOMDocument();
    wr.writeDocumentStart(doc);
    toXML(wr);
    wr.writeDocumentEnd(doc);
}
Also used : OutputFormat(org.dom4j.io.OutputFormat) DOMDocument(org.dom4j.dom.DOMDocument) DOMDocument(org.dom4j.dom.DOMDocument) Document(org.dom4j.Document) XWikiDocument(com.xpn.xwiki.doc.XWikiDocument) XMLWriter(com.xpn.xwiki.internal.xml.XMLWriter)

Aggregations

XWikiDocument (com.xpn.xwiki.doc.XWikiDocument)1 XMLWriter (com.xpn.xwiki.internal.xml.XMLWriter)1 Document (org.dom4j.Document)1 DOMDocument (org.dom4j.dom.DOMDocument)1 OutputFormat (org.dom4j.io.OutputFormat)1