locked
Multilevel mapping issue RRS feed

  • Question

  • Hi BizTalk community,

    I have the below mapping challenge (at least for me).

    I have two schemas Invoice and Journal and I want to resolve the transformation through a mapping.

    As example I created two simple schemas to explain how I need to iterate/loop:

    • Map Invoice child attributes (such as Total, Account Att1. etc) as the first Dtls record in Journal side.
    • Then map all occurrences of InvoiceDetails (such as Total, Account Att1. etc) into Dtls record in Journal side.

    Invoice

    <ns0:Invoice xmlns:ns0="">
         <Total>Total_0</Total> 
         <Account>Account_0</Account> 
         <Att1>Att1_0</Att1> 
         <Att2>Att2_0</Att2> 
         <Att3>Att3_0</Att3> 
         <InvoiceDetails>
              <Total>Total_0</Total> 
              <Account>Account_0</Account> 
              <Att1>Att1_0</Att1> 
              <Att2>Att2_0</Att2> 
              <Att3>Att3_0</Att3> 
         </InvoiceDetails>
    </ns0:Invoice>

    Journal

    <ns0:Journal xmlns:ns0="">
         <Hdr>
              <Company>Company_0</Company> 
              <Etc>Etc_0</Etc> 
         </Hdr>
         <Dtls>
              <Field_x0020_3>Field 3_0</Field_x0020_3> 
              <Field_x0020_2>Field 2_0</Field_x0020_2> 
              <Field_x0020_1>Field 1_0</Field_x0020_1> 
              <Account>Account_0</Account> 
              <Total>Total_0</Total> 
         </Dtls>
    </ns0:Journal>

    For example: if I have an incoming Invoice with 3 InvoiceDetails I should get 4 Dtls lines in Journal side.


    Thanks for your help!

    Martin.


    • Edited by Martin Anza Friday, April 6, 2018 3:29 PM Change title
    Friday, April 6, 2018 1:11 PM