One Star

Merge XML files with list of item inside

Hello,I try to merge 2 XML without merging the data of the same attributes. 

It is not very clear .. here is an example where the merge of part1 and part2 would give the objective.

Thank you in advance for your help.
And sorry for my approximate English.

 

 

--PART1

<value>
<id>648517</id>
    <lines>
      <netPrice>0.01</netPrice>
      <originalPrice>0.01</originalPrice>
      <qty>1</qty>
      <salesPriceItem>0.01</salesPriceItem>
      <itemId>D01</itemId>
      <vat>N</vat>
      <vatRate>20</vatRate>
      <vatValue>0.00</vatValue>
    </lines>
</value>


--PART2

<value>
<id>648517</id>
    <lines>
      <netPrice>toto</netPrice>
      <originalPrice>toto</originalPrice>
      <qty>toto</qty>
      <salesPriceItem>toto</salesPriceItem>
      <itemId>toto</itemId>
      <vat>toto</vat>
      <vatRate>toto</vatRate>
      <vatValue>toto</vatValue>
    </lines>
</value>

--OBJECTIVE

<value>
<id>648517</id>
    <lines>
      <netPrice>0.01</netPrice>
      <originalPrice>0.01</originalPrice>
      <qty>1</qty>
      <salesPriceItem>0.01</salesPriceItem>
      <itemId>D01</itemId>
      <vat>N</vat>
      <vatRate>20</vatRate>
      <vatValue>0.00</vatValue>
    </lines>
    <lines>
      <netPrice>toto</netPrice>
      <originalPrice>toto</originalPrice>
      <qty>toto</qty>
      <salesPriceItem>toto</salesPriceItem>
      <itemId>toto</itemId>
      <vat>toto</vat>
      <vatRate>toto</vatRate>
      <vatValue>toto</vatValue>
    </lines>
</value>

  • Data Integration
Tags (1)
1 REPLY
Seven Stars

Re: Merge XML files with list of item inside

Hi,

 

Do you have talend data mapper (It is not included in free talend version) ?

 

In your output file, you can have at the most 2 lines per id ?

 

Eric