I have modified the sample ContentControlsMergeXML a little to illustrate the issue.
The binding method is called with FLAG_NONE to make sure that the controls are removed in the output document:
- Code: Select all
Docx4J.bind(wordMLPackage, xmlStream, Docx4J.FLAG_NONE);
The attachment "binding-simple.docx" is the original document, the attachment "OUT_ContentControlsMergeXML.docx" is the result after binding.
As you can see formatting is still there on text without control, while formatting is reset to default on the text that was replaced by the XML binding.
Any suggestion on how this could be solved? I have searched the forum but couldn't find any posts that helped me solve the issue.
(I am using the latest docx4j-3.0.0.jar)