Search code examples
docx4j

Behavior of DataFields without a corresponding MERGEFIELD


If I pass in a map of fields to the getConsolidatedResultCrude() method, but some of the DataFields in the map don't have a corresponding MERGEFIELD in the docx file, will the unmapped data just be ignored, or will docx4j complain?


Solution

  • If a DataField in the map doesn't have a corresponding MERGEFIELD in the docx file, this won't matter (ie it will be ignored).

    In contrast, if a MERGEFIELD is encountered without corresponding data, a warning will be logged.