Append XML elements to XML file based on several input rows

Highlighted
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>
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...

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

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

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog