title: Biztalk mapping looping
body: <p>I have an input message with three segments like this</p>
  
  <pre><code>&lt;DDT&gt;
   &lt;NumeroDDT&gt;PS-1713445&lt;/NumeroDDT&gt; 
   &lt;Date&gt;2017-10-19&lt;/Date&gt; 
   &lt;NumeroLinea&gt;2&lt;/NumeroLinea&gt; 
  &lt;/DDT&gt;
  </code></pre>
  
  <p>But I want to map the lines (NumeroLinea) based on the value in it.<br/>
  So with value 2 like here it should become</p>
  
  <pre><code>&lt;DDT&gt;
   &lt;NumeroDDT&gt;PS-1713445&lt;/NumeroDDT&gt; 
   &lt;Date&gt;2017-10-19&lt;/Date&gt; 
   &lt;NumeroLinea&gt;1&lt;/NumeroLinea&gt;
   &lt;NumeroLinea&gt;2&lt;/NumeroLinea&gt; 
  &lt;/DDT&gt;
  </code></pre>
  
  <p>A sort of line counter.</p>
  
  <p>I have done so with an inline xslt functoid and hard coded like..<br/>
  if 1 make one line<br/>
  if 2 make two lines<br/>
  etc.<br/>
  That would have been good enough with few lines but the problem is it can be many lines, over 300 or more so it is a bad solution and does not work.</p>
  
  <p>Do you have any idea how to generate the <code>&lt;NumeroLinea&gt;</code> lines here based on the value from the input message?
  I have also tried looping functoiods but with no luck.</p>
  
  <p>Input schema and output schema is the same.</p>