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

Convert JSON To XML

This document discusses converting a JSON payload containing customer data into an XML payload. The JSON payload contains an array of customer objects with fields for CustomerID, CompanyName, and Country. The XML payload wraps the array of customers in an <ns0:MT_Customer> element in the http://cpi.sap.com/demo namespace and converts each customer object into a <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)
37 views

Convert JSON To XML

This document discusses converting a JSON payload containing customer data into an XML payload. The JSON payload contains an array of customer objects with fields for CustomerID, CompanyName, and Country. The XML payload wraps the array of customers in an <ns0:MT_Customer> element in the http://cpi.sap.com/demo namespace and converts each customer object into a <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 JSON to XML with namespace prefix

xmlns:ns0=http://cpi.sap.com/demo;xmlns:ns1=http://sap.com/xi/XI/SplitAndMerge

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

Target 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>
</row>
<row>
<CustomerID>BLAUS</CustomerID>
<CompanyName>Blauer See Delikatessen</CompanyName>
<Country>Germany</Country>
</row>
</ns0:MT_Customer>

You might also like