Rolf
Rolf

Reputation: 1

Biztalk mapping looping

I have an input message with three segments like this

<DDT>
 <NumeroDDT>PS-1713445</NumeroDDT> 
 <Date>2017-10-19</Date> 
 <NumeroLinea>2</NumeroLinea> 
</DDT>

But I want to map the lines (NumeroLinea) based on the value in it.
So with value 2 like here it should become

<DDT>
 <NumeroDDT>PS-1713445</NumeroDDT> 
 <Date>2017-10-19</Date> 
 <NumeroLinea>1</NumeroLinea>
 <NumeroLinea>2</NumeroLinea> 
</DDT>

A sort of line counter.

I have done so with an inline xslt functoid and hard coded like..
if 1 make one line
if 2 make two lines
etc.
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.

Do you have any idea how to generate the <NumeroLinea> lines here based on the value from the input message? I have also tried looping functoiods but with no luck.

Input schema and output schema is the same.

Upvotes: 0

Views: 330

Answers (1)

Rolf
Rolf

Reputation: 1

Found a very good solution at Seroter's blog Splitting Delimited Values in BizTalk Maps

I tried it and it worked well. All I have to do is to separate my input node with a pipe and this solution works fine.

Upvotes: 0

Related Questions