AnsweredAssumed Answered

How to Join/Combine XML in map

Question asked by srinijilla on May 24, 2017
Latest reply on May 25, 2017 by srinijilla

Hi,

 

I wanted to combine 2 xml tags based on their index.

Something like this

Input:

<Test>
     <SurveyVersions>
          <SurveyVersion>
               <SurveyID>17451</SurveyID>
               <VersionNumber>4</VersionNumber>
          </SurveyVersion>
          <SurveyVersion>
               <SurveyID>17452</SurveyID>
               <VersionNumber>5</VersionNumber>
          </SurveyVersion>
     </SurveyVersions>
     <ScheduleItems>
          <ScheduleItem_4_6>
               <SysCodes>6863</SysCodes>
               <Zones>A</Zones>
               <Markets>B</Markets>
          </ScheduleItem_4_6>
          <ScheduleItem_4_6>
               <SysCodes>6864</SysCodes>
               <Zones>C</Zones>
               <Markets>D</Markets>
          </ScheduleItem_4_6>
     </ScheduleItems>
</Test>

 

Output

<Test>
     <ScheduleItems>
          <ScheduleItem_4_6>
               <SysCodes>6863</SysCodes>
               <Zones>A</Zones>
               <Markets>B</Markets>
               
               <SurveyID>17451</SurveyID>
               <VersionNumber>4</VersionNumber>
          </ScheduleItem_4_6>
          <ScheduleItem_4_6>
               <SysCodes>6864</SysCodes>
               <Zones>C</Zones>
               <Markets>D</Markets>
               
               <SurveyID>17452</SurveyID>
               <VersionNumber>5</VersionNumber>
          </ScheduleItem_4_6>
     </ScheduleItems>
</Test>

 

Can anyone help me.

 

I tried to map, however resulting 4 rows in result. 2 of them correct and 2 or them are wrong.

Outcomes