I have a complex XML document. I have used the iText library to create a tagged PDF out of this XML document. I have referred to the examples in the 15th chapter of the iText in Action book but they are confined to a simple XML file having a hierarchy which is just one-level deep.
How can I extend my algorithm that works with the flat structure so that it can handle such hierarchical XML, such as in the below example?
Sample "Complex" XML document :
<?xml version="1.0" encoding="UTF-8" ?>
<movies>
<movie duration="141" imdb="0062622" year="1968">
<title>2001: A Space Odyssey</title>
<directors>
<director>Kubrick, Stanley</director>
</directors>
<countries>
<country>United Kingdom</country>
<country>United States</country>
</countries>
</movie>
</movies>