XML file data input, modification and uotput

Five Stars

XML file data input, modification and uotput

Suppose an organization pays their employees on a monthly basis. The salary of each
of its employees is tallied in an XML file for each month. According to the new requirements, the
new software must perform following things:
a) If an employee is not present during a month award them zero salaries.
b) If a particular month is not present in the salary XML file, award zero salaries
for that as well.

Community Manager

Re: XML file data input, modification and uotput

Do you want to generate a new XML file? What are you expected result? Can you show us an example output based on your input file?

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: XML file data input, modification and uotput

Hi Shong,

 

I want to generate XML file with added data.

XML file attached with the post(Once again attached to this post). Sample is as below. In below file there are only 6 months for employee. I want add remaining months(Total 12 months) and add zero salary to those months.

<Employees>
<EMP_NAME1>K</EMP_NAME1>
<Employee>
<EMP_ID>101</EMP_ID>
<EMP_NAME>Henry Mark</EMP_NAME>
<EMP_PROJECT_ID>P123</EMP_PROJECT_ID>
<SALARY>

<YEARLY Id="2013">
<MONTHLY>
<MONTH Id="1" Sal="60000"/>268600
<MONTH Id="2" Sal="20600"/>
<MONTH Id="3" Sal="26000"/>
<MONTH Id="4" Sal="67000"/>
<MONTH Id="5" Sal="68000"/>
<MONTH Id="6" Sal="27000"/>
</MONTHLY>
</YEARLY>
<YEARLY Id="2014">
<MONTHLY>
<MONTH Id="4" Sal="80000"/>
<MONTH Id="5" Sal="12000"/>
<MONTH Id="7" Sal="20000"/>
<MONTH Id="8" Sal="20000"/>
<MONTH Id="9" Sal="28000"/>
<MONTH Id="10" Sal="29000"/>
</MONTHLY>

 

Community Manager

Re: XML file data input, modification and uotput

Hi

See below scenario, it creates a new XML file based on your input example XML file, it adds new monthly salary element and set salary as 0 if it is not found in the source file. Snipaste_2019-11-27_16-03-37.pngSnipaste_2019-11-27_16-04-03.png

Snipaste_2019-11-27_16-04-58.pngSnipaste_2019-11-27_16-05-51.pngSnipaste_2019-11-27_16-06-57.pngSnipaste_2019-11-27_16-08-42.pngSnipaste_2019-11-27_16-09-15.png

Hope it helps and let me know if you have any questions.

 

Regards

Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog