Comment #2 on issue 249 by
markcdes...@gmail.com: Text is not escaped
Hi Angelo,
Sorry for the delayed response. Attached is a word doc, and below is the
code used to generate the error. I'm using xdoc reports v.1.0.0 &
freemarker 2.3.19
import fr.opensagres.xdocreport.document.IXDocReport;
import fr.opensagres.xdocreport.document.registry.XDocReportRegistry;
import
fr.opensagres.xdocreport.template.freemarker.FreemarkerTemplateEngine;
import
fr.opensagres.xdocreport.template.freemarker.internal.XDocFreemarkerContext;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import org.testng.annotations.Test;
public class WordXMLEscTest {
@Test
public void testEsc() throws Exception {
FreemarkerTemplateEngine engine = new FreemarkerTemplateEngine();
URL templateURL =
this.getClass().getResource("/templates/XMLEscapeTest.docx");
InputStream in = templateURL.openStream();
IXDocReport report =
XDocReportRegistry.getRegistry().loadReport(in, engine);
XDocFreemarkerContext context = new XDocFreemarkerContext();
context.put("account", "Mark & Co");
report.process(context, new FileOutputStream("/tmp/output.docx"));
}
}
Regards,
Mark
Attachments:
WordXMLEscTest.java 1.0 KB