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);
In the data XML I have placed a couple of empty nodes (element4, element5 & element6):
- Code: Select all
<myxml>
<element1>hydrogen</element1>
<element2>helium</element2>
<element3>lithium</element3>
<element4/>
<element5></element5>
<element6> </element6>
</myxml>
As you can see in the output document element1, element2, element3 and element6 (which has a space as value) are handled correctly, while element 4 and element5 are not.
Any suggestions on how this can be solved?
Thanks!