I would like to find text content between two keywords in .doc files, and conditionally render that text content or hide it. For example:
Lorem Ipsum is simply dummy text
${if condition}of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s${endif}
When I parse the document using the Apache - POI, I would like to be able in some way to spot in the document each and every content between these blockquotes ${if condition} ${endif} and conditionally render it or not in the next document I want to produce.
So the above text after my parsing should have the following two different forms:
1) In case the condition is satisfied
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
or
2) In case the condition is not satisfied
Lorem Ipsum is simply dummy text
I have tried to do this by using the XWPFParagraph object and then XWPFRun but that is no way reliable way as a run can be randomly split in the middle of a word under unpredictable conditions.
Could you please propose any reliable way to achieve my use case? Thanks in advance.