Mapping CSV to XML: Group Elements

One Star

Mapping CSV to XML: Group Elements

Job:

tFileInputDelimited --> tXMLMap --> TXMLOutput

 

CSV file structure:

ParticipantID   Gender   Participation

505   Male   Open

506   Female   Closed

 

Desired XML output for Row 2 of CSV (1 XML file per row):

<ID>
<key>ParticipantID</key>
<value>505</value>
</ID>

<Gender>Male</Gender>
  
<Participation>
<ParticipationType>OPEN</ParticipationType>
</Participation>

In Talend Integration, how do I nest?

- "<value>505</value>" within ParticipantID and ID tags

- "<ParticipationType>OPEN</ParticipationType>" within Participation tag

 

Thanks for your help.

Nine Stars

Re: Mapping CSV to XML: Group Elements

@Astrocyte - I would recommend to use tAdvancedFileOutputXML to make your output in the desired XML format.

Job Layout - 

tAdvancedFileOutputXML-2.JPG

XML tree configuration - 

tAdvancedFileOutputXML-1.JPG