Map Flatfile schema with repeating nodes input to one XML schema with repeating nodes output BizTalk

204 Views Asked by At

I'm trying to map a Flat file schema with multiple lines to an XML file with same multiple lines.

Input file example:

Username,"Certification ID","Certification Name","Date completed","Date due"
n2345678,55,"Name","2 Sep 2020",2-Mar-22
n1234567,55,"Name",,19-Mar-21

Output file example I would like to build with BizTalk mapper:

<Export>
    <Certificate>
        <Username>n2345678</Username> 
        <Date completed>2 Sep 2020</Date completed> 
        <Date due>2-Mar-22</Date due> 
        <Type>HarcodedField</Type> 
        <Kenmerk1>CalculatedField</Kenmerk1> 
        <Certification ID>55</Certification ID> 
        <Certification Name>Name</Certification Name> 
    </Certificate>
    <Certificate>
        <Username>n1234567</Username> 
        <Date completed /> 
        <Date due>19-Mar-21</Date due> 
        <Type>HarcodedField</Type> 
        <Kenmerk1>CalculatedField</Kenmerk1> 
        <Certification ID>55</Certification ID> 
        <Certification Name>Name</Certification Name> 
    </Certificate>
</Export>

For now I was only able to generate this output:

<Export>
    <Certificate>
        <Username>n2345678</Username> 
        <Date completed>2 Sep 2020</Date completed> 
        <Date due>2-Mar-22</Date due> 
        <Type>HarcodedField</Type> 
        <Kenmerk1>CalculatedField</Kenmerk1> 
        <Certification ID>55</Certification ID> 
        <Certification Name>Name</Certification Name> 
    </Certificate>
</Export>

What kind of functoid I had to use to loop on each lines of the input file to generate an output file with one Export node containing several Certificate nodes?

1

There are 1 best solutions below

0
tranesend On

Use the loop shape from the toolbox to map the rows from flat file schema to the "Certificate" from the output schema. Then set maxOccurs = unbounded on the Certificate element of the output schema and it should work