0
votes

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.

1
To clarify, you want the count of output NumeroLinea to equal the value in the input NumeroLinea? - Johns-305
Hi If the NumeroLinea has value 3 in the input message, I want go generate three segments of NumeroLinea in the output. NumeroLinea 1, NumeroLinea 2 and NumeroLinea 3 And if it has even more in the input like 250 I want to generate NumeroLinea 1 NumeroLinea 2 ... NumeroLinea 250 So the input decides the number of NumeroLinea nodes to generate. I think xslt is the only way to do this, but I don't find any good examples really. - Rolf

1 Answers

0
votes

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.