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.
Thanks,
Saurabh.
Employee

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.
Five 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...
PEOPLE_SOLUTION.zip
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.
Regards.
Eric