vinod.shetye039197

mapping query

Discussion created by vinod.shetye039197 on Jun 8, 2018
Latest reply on Jul 15, 2018 by brianbrinley

I am looking for solution to transform XML with multiple resultset to 1 resultset 

 

Source xml :

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MASTER_ELEMENT>
<RETURN>
<RT_ELEMENT_TYPE1>
<item>
<ELEMENTNAME>Element 1</ELEMENTNAME>
<ELEMENTVALUE>3168</ELEMENTVALUE>
<DESC>abc</DESC>
<DATE></DATE>
<STATUS></STATUS>
<TYPE></TYPE>
<COMPANY></COMPANY>
</item>
<item>
<ELEMENTNAME>Element 1</ELEMENTNAME>
<ELEMENTVALUE>3162</ELEMENTVALUE>
<DESC>xyz</DESC>
<DATE></DATE>
<STATUS></STATUS>
<TYPE></TYPE>
<COMPANY></COMPANY>
</item>
</RT_ELEMENT_TYPE1>
<RT_ELEMENT_TYPE2>
<item>
<ELEMENTNAME>Element 2</ELEMENTNAME>
<ELEMENTVALUE>00-3168</ELEMENTVALUE>
<DESC>abc23</DESC>
<DATE></DATE>
<STATUS></STATUS>
<TYPE></TYPE>
<COMPANY>1234</COMPANY>
</item>
<item>
<ELEMENTNAME>Element 2</ELEMENTNAME>
<ELEMENTVALUE>01-4168</ELEMENTVALUE>
<DESC>abc234</DESC>
<DATE></DATE>
<STATUS></STATUS>
<TYPE></TYPE>
<COMPANY>2345</COMPANY>
</item>
</RT_ELEMENT2>
</RETURN>
</MASTER_ELEMENT>

 

expected Destination xml :

<?xml version="1.0" encoding="utf-8"?>
<masterdata>
<masterelement>
<ELEMENTNAME>Element 1</ELEMENTNAME>
<ELEMENTVALUE>3168</ELEMENTVALUE>
<DESC>abc</DESC>
<DATE/>
<STATUS/>
<TYPE>type1</TYPE>
<COMPANY/>
</masterelement>
<masterelement>
<ELEMENTNAME>Element 1</ELEMENTNAME>
<ELEMENTVALUE>3162</ELEMENTVALUE>
<DESC>xyz</DESC>
<DATE/>
<STATUS/>
<TYPE/>
<COMPANY/>
</masterelement>
<masterelement>
<ELEMENTNAME>Element 2</ELEMENTNAME>
<ELEMENTVALUE>00-3168</ELEMENTVALUE>
<DESC>abc23</DESC>
<DATE/>
<STATUS/>
<TYPE/>
<COMPANY>1234</COMPANY>
</masterelement>
<masterelement>
<ELEMENTNAME>Element 2</ELEMENTNAME>
<ELEMENTVALUE>01-4168</ELEMENTVALUE>
<DESC>abc234</DESC>
<DATE/>
<STATUS/>
<TYPE/>
<COMPANY>2345</COMPANY>
</masterelement>
</masterdata>

 

I was trying split by each RT_ELEMENT_TYPE1 and then map each to destinations : not able to split 

 

Please, advise appropriate solution ...

 

thanks !

Outcomes