Processing Multi loop xml using talend data mapper

Four Stars

Processing Multi loop xml using talend data mapper

Hi ,
I am trying to process multi loop xml file using talend data mapper. Can any body help me with an example of processing multiloop xml. I want the output in a flat file , so one row for one id , with multi value element in a list column. 
Please help.

Re: Processing Multi loop xml using talend data mapper

The documentation has several looping examples in the Looping Cookbook and the Examples project (look in Other Projects) has many examples of maps with multiple nested loops.
Six Stars

Re: Processing Multi loop xml using talend data mapper

Hi Fupton/Team,
Could you please guide us on the below issue we are facing while trying to use data mapper:

We are using a sample xml having two looping elements. and aiming to get them in a csv format with looping element as a list.
We are able to loop the first element successfully (as an individual row for each looped elements,not as a list) but when we are trying to map the next looping element we are getting attached error.
Kindly advice how to resolve this and aggregate the looping element into a list.
Thanks and Regards,
Ojasvi Gambhir 
Not applicable

Re: Processing Multi loop xml using talend data mapper

Hi Ojasvi,
Please find enclosed a solution. There might be a more concisest and smartest solution...
My solution is:
1-Map PEOPLE_WITH_KEY add key ID in person loop, in city loop and nickname loop and call the next map (I then need these IDs)
2-Map PEOPLE_FLAT_BUT_CITY_LOOP makes nickname loop flat and call the next map
3-Map PEOPLE_FLAT makes city loop flat
In the zip folder, there are the maps, structures and a simple job that read the input file, then runs PEOPLE_WITH_KEY map with a tHmap component and finally wrote down the output file.
Let me know if it meets your requirements.
Once again there might be something simpler, I'm not a TDM expert.
Seven Stars

Re: Processing Multi loop xml using talend data mapper

Hi There 


I am facing same issue.

Is it possible to map multiple loop into a single flat file in single Map. I have 4 multiple loop around 90 columns. I am unable to understand how to created another XML structure and then generate flat file. 


Please suggest. 


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.