Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
53 views1 page

JSON to XML Conversion Guide

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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views1 page

JSON to XML Conversion Guide

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
We take content rights seriously. If you suspect this is your content, claim it here.
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