Suppose I have a XML input file with the following format:
<xml> <addresses> <loading></loading <discharge></discharge> </addresses> <orders> <order> <addresses> <loading></loading <discharge></discharge> </addresses> <orderno>1</orderno> </order> <order> <orderno>2</orderno> </order <order> <orderno>3</orderno> </order </orders> </xml>
I have several order documents that fall into 2 categories:
1. The document starts with static information:
This static information is the same for each order so that is why it is displayed first
After this static information a table is displayed with one row per order (so in this example 3 rows)
2. Each order is displayed on one page with the static information. So with the xml example above I'll have 3 pages
The addresses I can make conditional so only use the addresses above the orders block (/xml/addresses) when a document
in category 1 is encountered. Show addresses per order when a document in category 2 is encountered.
Is it possible to do what I want in 1 data mapper or is it unavoidable to use multiple data mappers for this specific case?