There are 2 field representations in OpenXML, simple and complex. See
http://webapp.docx4java.org/OnlineDemo/ ... L/XML.htmlFor a simple field implementation, the body of the element contains the most recently updated field result, for example:
Using xml Syntax Highlighting
<w:r>
<w:fldSimple w:instr="DATE"> 12/31/2005
</w:fldSimple>
</w:r>
Parsed in 0.000 seconds, using
GeSHi 1.0.8.4
So that's straightforward (provided you are happy with the current field result), you just remove the fldSimple element, keeping its contents.
For a complex field implementation, you have an ugly set of runs:
• fldChar with attribute fldCharType value begin,
• One or more instrText elements, which, collectively, contain a complete field,
• Optionally,
• fldChar with attribute fldCharType value separate, which separates the field from its field result,
• Any number of runs and paragraphs that contains the most recently updated field result, and
• fldChar with attribute fldCharType value end.
So to process these, you need maintain state...
What docx4j gives you out of the box you can explore by trying the XHTML and XSL FO output.