cancel
Showing results for 
Search instead for 
Did you mean: 

Message mapping with dynamic node

Former Member
0 Kudos

Hi,

I am doing message mapping where my source structure is

<root>

<EmpCount>2</EmpCount>

<Emp>

<item>

<code>1</code>

<name>ABC</name>

</item>

<item>

<code>2</code>

<name>PQR</name>

</item>

</Emp>

<root>

If EmpCount is having value 2 then Emp node will have only 2 items

Target structure is flat structure like (something like fix file format)

<root>

<EmpData>EmpDetails</EmpData> occurrences 0...unbounded

</root>

With above sources data following is expected target sturcure…

<root>

<EmpData>2ABC</EmpData>

<EmpData>3PQR</EmpData>

</root>

Here my query is how I can create more than one node to target structure with employee details.

I already tried with following

This help to get all 2 nodes of EmpData in target structure but it is showing only First value in both nodes. Following is output I am getting…

<root>

<EmpData>2ABC</EmpData>

<EmpData>2ABC</EmpData>

</root>

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

Sunil,

Please see the sample i/p and o/p payload. Also please let me know , is this the same u are looking for

I/P

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

<ns0:MT_Check xmlns:ns0="urn:hdmc:samplescenarios">

<EmpCount>2</EmpCount>

<Emp>

<Item>

<Code>1</Code>

<Name>A</Name>

</Item>

<Item>

<Code>1</Code>

<Name>B</Name>

</Item>

</Emp>

</ns0:MT_Check>

O/P

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

<ns0:MT_Check_Out xmlns:ns0="urn:hdmc:samplescenarios">

<Root>

<EmpData>2A</EmpData>

<EmpData>2B</EmpData>

</Root>

</ns0:MT_Check_Out>

Best regards,

raj.

Former Member
0 Kudos

Thanks Raj.... for such nice reply.....

Point has been awarded

justin_santhanam
Active Contributor
0 Kudos

Sunil,

Its fine, did u got the output.

Best regards,

raj.

Answers (1)

Answers (1)

justin_santhanam
Active Contributor
0 Kudos

Sunil,

<b>Links Removed</b>

If you have any doubts revert back.

Best regards,

raj