cancel
Showing results for 
Search instead for 
Did you mean: 

Node problem in mapping

Former Member
0 Kudos

Hi,

I have a mapping which throws an error. The problem is like below:

When I duplicate the ITEM node in the source structure I get an error for the target. The ITEM (target) contains fields of the header (source). Any Idea how to solve? The error says it cant generate field "y". (note: when I dont duplicate the ITEM (source) it works.)

source node:

ROOT

Header (1 to 1)

a

b

c

d

ITEM (1 to unbounded)

e

f

g

h

target node:

ROOT

HEADER (1 to 1)

x = a+b

ITEM (1 to unbounded)

y = c*d

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please use "useOneAsMany" function to map target element 'y':

c*d(1 Argument)

ITEM(2 Argument)--


> useOneAsMany--> y

e(3 Argumnet)

Thanks

Amit

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

> When I duplicate the ITEM node in the source structure

How do you duplicate node in source and why?

Former Member
0 Kudos

hi Stefan,

In the Source structure there can be more then 1 item node.

for example:

source:

header (always 1)

...

item

...

item

...

item

...

In the target. I have also one header and the item node as many items as there is in the source.

When I use test mapping, I duplicate the item node and test it. it throws an error. when I do not duplicate and use just one item it works.

stefan_grube
Active Contributor
0 Kudos

> When I use test mapping, I duplicate the item node and test it. it throws an error. when I do not duplicate and use just one item it works.

I see. You are talking about test node.

How do you want to have the output of the mapping, when you have several item nodes in source?

Provide an example source XML and and example target XML that you want to achieve.

Former Member
0 Kudos

source:

ROOT

Header

name John

surname Walter

age 43

company ABC

ITEM

a ... (doenst matter in my case)

b ... (doenst matter in my case)

ITEM

a ... (doenst matter in my case)

b ... (doenst matter in my case)

target:

ROOT

Header

name John Walter

age 43

ITEM (this item field is assigned to the item field of the source, when the source item is more then one then this will duplicate as well)

a (if name is different the "0" than assign age (from header) to field "a") (if name is "John" then assign company from header to field "a")

ITEM

a (if name is different the "0" than assign age (from header) to field "a") (if name is "John" then assign company from header to field "a")

The problem is as said before. When I have one item in the source it works. when I have 2 item in the source it throws an error?

Edited by: Chris027 on May 31, 2010 11:22 AM

stefan_grube
Active Contributor
0 Kudos

> The problem is as said before. When I have one item in the source it works. when I have 2 item in the source it throws an error?

As Amit has already mentioned, use node function "useOneAsMany".