Pentaho

 View Only

 xml merge

  • Pentaho
  • Pentaho
archana garikapati's profile image
archana garikapati posted 06-07-2019 02:12

merging xml files. i need to sum the values of both the files and output in final xml file.

File1-------

<OvrllTtl>

 

<Ag> <St> <Vol>5</Vol> <Val>10</Val> </St> <Fail> <Vol>15</Vol> <Val>20</Val> </Fail> <Ttl> <Vol>25</Vol> <Val>30</Val> </Ttl> </Ag> <FaildRate> <VolPct>70</VolPct> <Val>100</Val> </FaildRate></OvrllTtl>

File2--------

 

<OvrllTtl>

 

<Ag> <St> <Vol>5</Vol> <Val>10</Val> </St> <Fail> <Vol>15</Vol> <Val>20</Val> </Fail> <Ttl> <Vol>25</Vol> <Val>30</Val> </Ttl> </Ag> <FaildRate> <VolPct>70</VolPct> <Val>100</Val> </FaildRate></OvrllTtl>

Expected output----

<OvrllTtl>

<Ag> <St> <Vol>10</Vol> <Val>20</Val> </St> <Fail> <Vol>30</Vol> <Val>40</Val> </Fail> <Ttl> <Vol>50</Vol> <Val>60</Val> </Ttl> </Ag> <FaildRate> <VolPct>140</VolPct> <Val>200</Val> </FaildRate></OvrllTtl>


#Pentaho
David da Guia Carvalho's profile image
David da Guia Carvalho

In this case seems that you actually don't need to force a "merge" files (by join). As both have the same structure you can put 2 flows based on "XML input" use "Agg" step and a "XML output".

archana garikapati's profile image
archana garikapati