AnsweredAssumed Answered

JSON Transform assertion changes the sequence of elements

Question asked by bemine.Naren on Apr 16, 2015
Latest reply on Apr 18, 2015 by bemine.Naren

Hi,

 

I am using the JSON transformation assertion to transform my JSON request to XML. But for a complex JSON object, the elements sequence gets changed. I have a given a simple example below for understanding. Does anyone know how to keep the sequence while transformation?

 

Example JSON String

"{ employee : { age:32, name : venugopal Darur,  employed:true}}";


XMl String expected is


<employee>

     <age>32</age>

     <name>Venugopal Darur</name>

    <employed>true</employed>

</employee>


But I get this:

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

<Test>

    <employee>

        <name>venugopal Darur</name>

        <age>32</age>

        <employed>true</employed>

    </employee>

</Test>

 

Help is much appreciated.

Outcomes