cancel
Showing results for 
Search instead for 
Did you mean: 

Repeating data

Former Member
0 Kudos

I have an XML file with looping data. When I map the fields it only gets the first one.

My XML:

<services>

<service name="A" value="1"></service>

<service name="B" value="2"></service>

<service name="C" value="3"></service>

</services>

Although in data type the service node is set to 1..unbound it only takes <service name="A" value="1"></service> and skips the others.

What I want as output is:

serviceA="1"

serviceB="2"

serviceC="3"

serviceD=""

...

My mapping:

for field serviceA: if service-name equals to "A" assign value.

for field serviceB: if service-name equals to "B" assign value.

for field serviceC: if service-name equals to "C" assign value.

for field serviceD: if service-name equals to "D" assign value.

...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

use removeContext function after name while mapping as


name---->removeContext---->your mapping logic

use display Queue to debug the mapping then you will understant why your mapping logic is getting failed.

Former Member
0 Kudos

>

> use removeContext function after name while mapping as

>


> name---->removeContext---->your mapping logic
> 

>

> use display Queue to debug the mapping then you will understant why your mapping logic is getting failed.

That solved the problem. Thank you.

How can I display the queue to debug the mapping. Can you explain?

Answers (3)

Answers (3)

Former Member
0 Kudos

right click on any of the field involved in target field mapping and select Display Queue from the context menu.

Former Member
0 Kudos

Set the context of name to services

Former Member
0 Kudos

Hi Ali,

Are you using the text function equals? Also only compare with A dont put "A" and try out.

Regards,

Satish

Former Member
0 Kudos

Yes I'm using the text equals function, it takes the first value correctly. There is no problem with the mapping, but I think it doesn't loop the structure.