0

I want get to the variables(${colour}) list and then pass the variables dynamically.Is it possible to get the variables list.

Thanks

MMM
  • 63
  • 3
  • 10

1 Answers1

0

You'll have to write code to do that yourself.

Three approaches:

  1. Use TextUtils to get just the text, and parse for ${
  2. Use XPath
  3. Use Traverse utils

All 3 of these are documented further in docx4j's Getting Started.

Method 1 is the simplest, I guess.

Could your variables be in headers/footers/footnotes/endnotes? If so, note these are separate "parts", and would also need to be handled.

JasonPlutext
  • 15,352
  • 4
  • 44
  • 84