cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping problem

Former Member
0 Kudos

Hi guys,

I have a problem in mapping and I don't know, how to solve it.

My source structure is like:

+SourceMessage (1)

++NodeA (N)

+++ElementA (1)

+++NodeB (0..N)

++++ElementB (1)

My target structure is like:

+TargetMessage (1)

++Document (N)

+++ElementA (1)

+++NodeB (N)

++++ElementB (1)

The structures are almost the same, but - I need as many target Document nodes, as occurence of NodeB is in the source structure. This is not a problem, but I need also to map ElementA to ElementA and of course, I need THAT ElementA value, which is contained in the NodeA, where also the NodeB is (from which occurence's is target Document node created).

Example:

+SourceMessage

++NodeA

+++ElementA=8

++NodeA

+++ElementA=10

+++NodeB

++++ElementB

and the target will be:

+TargetMessage

++Document

+++ElementA=10

+++NodeB

++++ElementB

Thank you for your help,

Peter

Accepted Solutions (0)

Answers (4)

Answers (4)

justin_santhanam
Active Contributor
0 Kudos

Peter,

If you could give us the source xml and target expected XML, it would be easy for us to visualize and work on it.

raj.

Former Member
0 Kudos

Hi,

Can u tell me what is the condition of creation of the document.

Thanks,

Bhargav

Edited by: bhargav gundabolu on Mar 5, 2008 4:18 PM

Jitendra_Jeswan
Contributor
0 Kudos

Here is the Solution :

1) Mapping for Document node in the target

ElementA>exists>

NodeB ->exists-> equals(boolean)--->createIf->removecontext()--->Document

2) ElementA-->ElementA

3) NodeB-->NodeB

4) ElementB-->ElementB

This would solve your problem.

Reward points.

GabrielSagaya
Active Contributor
0 Kudos

You can use UseOneasMany Node function

NodeA-->

NodeB-->

NodeA> Useoneasmany>Document

Former Member
0 Kudos

Hi Gabriel,

I can't use OneAsMany with NodeA, it has multiple occurence..

Any other ideas?

Thanks,

Peter

GabrielSagaya
Active Contributor
0 Kudos

Hi peter,

As per your requirement,

Whenever Node B exist in Node A that should be present in target Document

Whether My Understanding is right ???

if so...

nodeb>exist()->if then>nodeA>Formatbyexample--> Document