Search in sources :

Example 1 with CdataContentXmlWriter

use of org.freeplane.n3.nanoxml.CdataContentXmlWriter in project freeplane by freeplane.

the class AddOnProperties method toXmlString.

public String toXmlString() {
    try {
        final String header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
        final StringWriter writer = new StringWriter();
        final CdataContentXmlWriter xmlWriter = new CdataContentXmlWriter(writer);
        xmlWriter.addRawContent(header);
        xmlWriter.addRawContent(System.getProperty("line.separator"));
        xmlWriter.write(toXml(), true);
        return writer.toString();
    } catch (IOException e) {
        // StringWriter does not throw an exception but anyhow...
        throw new RuntimeException(e);
    }
}
Also used : StringWriter(java.io.StringWriter) CdataContentXmlWriter(org.freeplane.n3.nanoxml.CdataContentXmlWriter) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 StringWriter (java.io.StringWriter)1 CdataContentXmlWriter (org.freeplane.n3.nanoxml.CdataContentXmlWriter)1