I have xml structure like this:
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<sections>
<section name="Name of the first section" id="1" ordinal="1" description="Description of the first section.">
<subsection name="Name of first subsection" id="2" ordinal="1" description="Description of the first subsection.">
<feature name="First feature name" id="3" ordinal="1" description="First feature description.">
<parameter name="parameterName1" value="parameterValue1" type="type1"/>
<parameter name="parameterName2" value="parameterValue2" type="type2"/>
</feature>
<feature name="Second feature name" id="4" ordinal="2" description="Second feature description.">
<parameter name="parameterName1" value="parameterValue1" type="type1"/>
<parameter name="parameterName2" value="parameterValue2" type="type2"/>
</feature>
</subsection>
<subsection name="Name of second subsection" id="5" ordinal="2" description="Description of the second subsection.">
<feature ...>
...
</feature>
<feature ...>
...
</feature>
</subsection>
</section>
<section>
...
</section>
</sections>
The number of sections, subsections, features and parameters is defined in runtime and can be changed dynamically while application is running.
I have to transform this xml (or object structure) to word and optionaly to pdf.
The docx result should look like in docx attached. Additional requirement is to have an ability to change styles, fonts, colors, headings and footers for resulting docx without changes to java code.
How to achieve this task with docx4j?