0

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.

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
Rolf
  • 1
  • To clarify, you want the count of output NumeroLinea to equal the value in the input NumeroLinea? – Johns-305 Feb 09 '19 at 16:04
  • 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 Feb 09 '19 at 17:13

1 Answers1

0

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.

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
Rolf
  • 1
  • Hi Rolf. Well done on solving your problem. If you could add some more details to the answer that would be good. An answer which only contains a link and not enough details for someone to use that answer without a link is considered low quality and they tend to get deleted. This is because if the page that is being linked to disappears, then the answer becomes useless – Dijkgraaf Feb 10 '19 at 00:06