01: package ru.emdev.EmForge.wiki;
02:
03: import java.io.IOException;
04: import java.io.StringWriter;
05:
06: import org.jdom.output.Format;
07:
08: import com.ecyrd.jspwiki.WikiContext;
09: import com.ecyrd.jspwiki.parser.WikiDocument;
10: import com.ecyrd.jspwiki.render.XHTMLRenderer;
11:
12: public class EmForgeRendererImpl extends XHTMLRenderer {
13:
14: public EmForgeRendererImpl(WikiContext context, WikiDocument doc) {
15: super (context, doc);
16: }
17:
18: public String getString() throws IOException {
19: m_document.setContext(m_context);
20:
21: EmForgeXMLOutputter output = new EmForgeXMLOutputter();
22:
23: StringWriter out = new StringWriter();
24:
25: Format fmt = Format.getRawFormat();
26: fmt.setExpandEmptyElements(false);
27: fmt.setLineSeparator("\n");
28:
29: output.setFormat(fmt);
30: output.outputElementContent(m_document.getRootElement(), out);
31:
32: return out.toString();
33: }
34:
35: }
|