we have a requirement to transmit data from one system to another, basically it will be a complex JSON provided to us and then we should be able to forward it either in JSON string or XML.string
Now to achieve JSON to XML there are api available for ClipboardPage class in java like adoptJSONObject, getXML. but the problem is the XML generated is not desirable as it can contain pega naming convention for lists like pagelist, repeating index = 1.
How can I create a standard XML, which can be accepted outside by a non-pega application?
I am attaching an example for instance: file "whatIGet" is constructed using pega api and file "whatToAchieve" is what I want to get.
Also I wrote below function to convert JSON to XML.
@Gaurav_Kumar Perhaps a better solution would be to use the JSONObject class.The below code snippet should be able to convert a JSON string directly into an XML string, without the additional PEGA-related fields attached to it.
JSONObject json = new JSONObject(str);
String xml = XML.toString(json);
Better still, this class is already present within your PEGA instance, so no additional 3rd party JAR is required to be installed.