Hi,
i want use my templates with some placeholder for dinamically replace.
I read this topic (
http://dev.plutext.org/forums/viewtopic.php?f=6&t=6&sid=43f1d4b2a5fa55a3c6746ed0c72ecb96), but i found this solution a lot impractical.
I want test this solution:
//read template file
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
.load(new java.io.File(templateFileWithPlaceHolder));
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
Document wmlDocumentEl1 = (Document) documentPart.getJaxbElement();
org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml.Document) documentPart
.getJaxbElement();
//xml --> string
String xml = XmlUtils.marshaltoString(wmlDocumentEl, true);
HashMap<String, String> mappings = new HashMap<String, String>();
mappings.put("PROP1", "bla");
mappings.put("PROP2", "bla bla"); ...