cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Segments down to 1

Former Member
0 Kudos

Hi,

I have very limited XI mapping experience. I'm trying to convert the following XML:

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:Input_msg xmlns:ns0="http://test.com/XI/test">

<Message>

<Field_type>1</Field_type>

<Field>Value1</Field>

</Message>

<Message>

<Field_type>2</Field_type>

<Field>Value2</Field>

</Message>

</ns0:Input_msg>

Into:

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:Output_msg xmlns:ns0="http://test.com/XI/test">

<field1>Value1</field1>

<field2>Value2</field2>

</ns0:Output_msg>

If Field_type = 1 then put the value of field into field1.

If field_type = 2 then put the value of field into field2.

I created a mapping using IfWithoutElse. It only gives me the following:

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:test_msg xmlns:ns0="http://test.com/XI/test">

<field1>Value1</field1>

</ns0:test_msg>

It doesn't put the value in for field2.

Is there a way to do this using XI Mapping functionality?

Thanks,

Jeff

Accepted Solutions (1)

Accepted Solutions (1)

STALANKI
Active Contributor
0 Kudos

Use createif node function that should easily solve the problem.I guess you need to create an element in target based on some condition.Createif definetly helps.

Answers (1)

Answers (1)

Former Member
0 Kudos

I solved this by setting the context of the fields to the input_msg rather than message.