AnsweredAssumed Answered

Looping issue with XML mapping

Question asked by KevinWang1261 on Nov 17, 2015
Latest reply on Nov 18, 2015 by KevinWang1261
Has anyone had issues with looping while mapping XML to XML?

If I map input fields directly to output, then I get a situation where the <ItemDesc> is repeated. I tried playing with the "Looping options" set to 'occurrence', but that didn't seem to work. The only way I can get this to react the correct way is to restrict the "Max occurs" to 1... but this is not the right way to manage this. We don't want to unnecessarily restrict the profile.

The following is a representation of the issue:

Input:
      <PO>
<Header>
<Line>
     <Item>
           <ItemId>partA</ItemId>
           <Desc>
                  <ItemDesc>partA desc</ItemDesc>
           </Desc>
     </Item>
</Line>
     <Item>
           <ItemId>partB</ItemId>
           <Desc>
                  <ItemDesc>partB desc</ItemDesc>
           </Desc>
     </Item>
</Line>
</Header>
      </PO>
 
Output:
      <PO>
<Header>
<Line>
     <Item>
           <ItemId>partA</ItemId>
           <Desc>
                  <ItemDesc>partA desc</ItemDesc>
                  <ItemDesc>partB desc</ItemDesc>

           </Desc>
     </Item>
</Line>
     <Item>
           <ItemId>partB</ItemId>
           <Desc>
                  <ItemDesc>
partA desc</ItemDesc>
                  <ItemDesc>partB desc</ItemDesc>
           </Desc>
     </Item>
</Line>
</Header>
      </PO>

Outcomes