Append XML elements to XML file based on several input rows

One Star

Append XML elements to XML file based on several input rows

I would like to create the following XML file based on input values. The input is simulated by tFixedFlowInput in the attached job:
<?xml version="1.0" encoding="ISO-8859-15"?>
<test>
<testsub testattr="89">
<testsubsub>59</testsubsub>
</testsub>
<testsub testattr="47">
<testsubsub>86</testsubsub>
</testsub>
</test>
But unfortunately the result looks as follows:
<?xml version="1.0" encoding="ISO-8859-15"?>
<test>
<testsub testattr="89">
<testsubsub>59</testsubsub>
</testsub>
</test>
<?xml version="1.0" encoding="ISO-8859-15"?>
<test>
<testsub testattr="47">
<testsubsub>86</testsubsub>
</testsub>
</test>
Highlighted
Four Stars

Re: Append XML elements to XML file based on several input rows

ohofrichter - I tried to replicate your issue and unchecked the "Remove the XML declaration" on tWriteXMLField. That didn't work - I was expecting it to remove the declaration lines between the rows...
I know that tXMLMap allows you to write only 1 xml declaration per file, regardless of how many rows you have... But that's no help with your current design...

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.