AnsweredAssumed Answered

How to get formatted output in xml (Country names along with continent) from given input??

Question asked by iamshinde on May 9, 2017
Latest reply on May 10, 2017 by roundviewjoseph

Hi All,

 

We have the below input :

 

AMERICA||ARGENTINA~AMERICA||COSTARICA~AMERICA||MEXICO~AFRICA||VENEZUELA~AFRICA||SOMALIYA

 

and we want this output should come in below format:

<root>

   <region>

        <region_name>AMERICA</region_name>

        <country>ARGENTINA</country>

        <country>ARGENTINA</country>

        <country>ARGENTINA</country>

   </region>

   <region>

         <region_name>AFRICA</region_name>

         <country>VENEZUELA</country>

         <country>SOMALIA</country>

   </region>

</root>

 

when i tried one poc it's returning different output as you can see the below screen shots

 

1) I kept the input data in message shape you can see the below screen shot

2) I am spliting data based on ~ symbol and sending it to flat profile single element.

3) I used map to split the region and country individually using split fun in map based on [||] symbol

4) then I am mapping the output to xml profile.

 

 

 

 

 

 

 

final output it's individual docs for each country:

 

 

 

 

 

Many thanks

Outcomes