cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping question - one dimensional to two dimensional

Former Member
0 Kudos

Hi

We are on XI 3.0 SP13 - and I have this mapping scenario

Source structure - Linear & simple with say 10-20 fields -

Target structure - Name -value field pair with an unbounded node on top -

<b>MsgAttrib 0-Unbounded

Name

Value</b>

I have to map each distinct field value from the source structure - to the Value field on target structure. The Name field in the target structure should contain the name of the source field ( it can contain a constant - field name if we cannot get the source element name during mapping runtime, thats ok )

So basically each elementname and its value on the source structure form a record on the target xml. The next source element and its value will be mapped to the next record on the target xml - this filling up the two dimensional target structure - with as many rows as the number of source fields to be mapped. The number of such source fields to be mapped can grow . ( there should not be any limitation on that )

Can this be accomplished using standard functions in message mapping - or should we resort to writing udfs ?

Any right thoughts, solutions to solve this mapping scenario will be awarded points rightaway .....

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Karthik,

if you want a quick-and-dirty solution, you could try the following:

1.) In the target message, duplicate the subtree 'MsgAttrib' (use right mouse click) so that you have one 'MsgAttriv' subtree for each distinct field in the source message

2.) Assign the names of the source fields to the field 'Name' of the respective target subtree using the constant function

3.) Map the source fields to the field 'Value' of the respective target subtree

4.) Map the source fields to the 'MsgAttrib' node of the respective target subtree. You may have to use the function 'CollapseContext' in order to make it work.

If you want have a more dynamic solution, you can use a java mapping (no udf) with some dynamic xml programming in it.

Regards,

Matthias

Former Member
0 Kudos

Hi karthik,

The mapping that ur scenario requires can be accomplished using the standard functions...

now ur source structure is unbounded...tht means it can have multiple occurences...

and for each occurence you have a pair of values in target message under a node....

now the important thing here is ..tht ur target node which has those two fields under it will repeat as many times as occurences of the source message...

so u need to map the main message type node of the source to this node in target...

and according map the fields under tht node...

UDF's are not required for this....

Regards ,

Sushil Hadge

Former Member
0 Kudos

Hi KARTHIK,

from what you wrote I do not think you need UDF or java mapping, but could you give a sample of source and target messages? how are the source message fields?

With an example it could be easier to help you.

Kind Regards,

Sergio