0% found this document useful (0 votes)
26 views

Convert XML To JSON

This document describes converting an XML payload containing customer data into a JSON payload. The XML payload contains two customer records under the <row> element, with fields for CustomerID, CompanyName, Country, and Count. The conversion outputs the same data in JSON format, with the two customer records represented as an array within the "row" element.

Uploaded by

Akash Saini
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Convert XML To JSON

This document describes converting an XML payload containing customer data into a JSON payload. The XML payload contains two customer records under the <row> element, with fields for CustomerID, CompanyName, Country, and Count. The conversion outputs the same data in JSON format, with the two customer records represented as an array within the "row" element.

Uploaded by

Akash Saini
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Convert XML to JSON

Source payload:
<?xml version='1.0' encoding='UTF-8'?>
<ns0:MT_Customer xmlns:ns0="http://cpi.sap.com/demo">
<row>
<CustomerID>ALFKI</CustomerID>
<CompanyName>Alfreds Futterkiste</CompanyName>
<Country>Germany</Country>
<Count>123</Count>
</row>
<row>
<CustomerID>BLAUS</CustomerID>
<CompanyName>Blauer See Delikatessen</CompanyName>
<Country>Germany</Country>
<Count>888</Count>
</row>
</ns0:MT_Customer>

Target payload:
{
"row": [
{
"CustomerID": "ALFKI",
"CompanyName": "Alfreds Futterkiste",
"Country": "Germany",
"Count": "123"
},
{
"CustomerID": "BLAUS",
"CompanyName": "Blauer See Delikatessen",
"Country": "Germany",
"Count": "888"
}
]
}

You might also like