cancel
Showing results for 
Search instead for 
Did you mean: 

Generating target XML tag from a value in the Source XML document

Former Member
0 Kudos

Hi there,

I have a scenario where the following transformation needs to occur:

Source Message...

<Catalogue>

<key>abc<\key>

<value>123<\value>

<key>def<\key>

<value>456<\value>

...

<\Catalogue>

Target Message...

<Catalogue>

<abc>123<\abc> --> Value of KEY becomes the XML tag and the VALUE gets assigned to it

<def>456<\abc>

...

<\Catalogue>

The target message is written to an xml file using the receiver file adapter.

I would like the target message generation to be dynamic so that when a new key-value pair is added, it would not require a change in the XI mapping layer. Is there a way to accomplish this without having to code or enhance the adapter. I am trying to avoid doing this in the mapping because that would mean changing the mapping every time a new key-value pair needs to be added.

Any suggestions to accomplish this are welcome.

Thanks all.

Accepted Solutions (1)

Accepted Solutions (1)

GabrielSagaya
Active Contributor
0 Kudos

You can use XSLT mapping for generating target XML.

XSLT mapping

Former Member
0 Kudos

Hi,

I doubt if it will work for you. you can generate dynamic values using this but not tags dynamically. You need to see if there are any methods to generate tags dynamically.

One way of doing this is by using Java Mapping and playing around with InputStream and OutputStream.It will work for sure with this.

Thanks

Amit

Answers (0)