Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In recent times, JSON format is increasingly being used for serializing and transmitting structured data over a network connection like data transmission between server and a web application. Since JSON format is not widely adopted by all organizations yet, and as most of the data exchange is done through XML in earlier networks which have not deployed JSON, conversion from JSON to XML or vice-versa has become essential for data inter-operabilityinteroperability.

Configuration

Below is the JSONConverter Component Property Sheet (CPS) with Expert Properties (Click icon) enabled.

...

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<abc>
   <shiporder orderid="orderid">
      <item>
         <quantity>
            <bcd>12</bcd>
            <bcd>15</bcd>
            <bcd>23</bcd>
            <bcd>45</bcd>
         </quantity>
         <title>title</title>
      </item>
      <orderperson>orderperson</orderperson>
      <shipto>
         <country>country</country>
         <name>name</name>
      </shipto>
   </shiporder>
</abc>

Useful Tips

  • Output port and Input port XSD schemas can be used for mapping transformations for corresponding JSONtoXML and XMLtoJSON conversions.
  • In order to preserve the data type while converting an Input XML to JSON, specify the "type" attribute in the input XML.

    Info
    titleExample
    Code Block
    titleInput
    <root>
       <test type="integer">1</test>
    </root> 
    Code Block
    titleOutput
    {
      "root" : {
        "test" : 1
      }
    }
Adaptavist ThemeBuilder EngineAtlassian Confluence