Are there any best practices for generating a document by deleting sections from a template? (Sections purely in the sense below, not the Word sense)
My main use of docx4j is as a document generator.
Documents typically have:
Heading 1
Clause i
Clause ii
Sub-heading a
Clause i...
Heading 2
Sub-heading a
Clause I
Table
Image...
Heading 3...etc.
However sometimes Heading 2 (and all content) isn't relevant, so I'd like to delete it.
The system that I have working currently relies on hardcoded indexes (i.e. getContents(12).remove(), get contents(13).remove()...), so everything is thrown out of whack if I or someone helping me adds a new clause somewhere in the middle.
I was hoping that the tree structure would store paragraphs inside headings, making them simple to delete, but evidently this isn't how the docx format works.
Struggling to decide whether or not to use content controls, which I can train someone to use while editing my docs, OpenDoPE (could someone who isn't a programmer still help me update my documents with this?), or other tools and how to go about this.
Thanks in advance,
Kai_