Reading complex hierarchical XML

The first two recipes show how tXMLMap can be used to map between XML formats visually, much like the tMap component; however, it can become overly complex and difficult to manage when there are multiple levels of hierarchy and multiple loops within the XML. This recipe shows how we can deconstruct a more complex XML record into individual sets of data while ensuring that the hierarchical relationships between the data are not lost.

Getting ready

Open the job jo_cook_ch09_0040_readComplexXML file. If you view the input file chapter09_jo_0040_orderDate.xml, you will see that we have a hierarchy of customer that has many orders, and orders have many items.

How to do it...

First, we will create a customer schema using ...

Get Talend Open Studio Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.