02-07-2019 08:27 AM
Hi,
I want to convert JSON to XML and i’m using XML Generator with valid XSD.
I got the output XML after running the pipeline for a fixed known JSON format with fixed XSD.
If the JSON data is dynamic, Now I don’t know the JSON data format because it is a third party data getting from some REST GET snap request. I cannot define exact XSD in XML Generator snap.
Is there a way where the XML Generator generates XML from the dynamic JSON without depending on XSD?
Thanks,
Kiran
02-07-2019 02:24 PM
If what you are trying to do is generate XML output from JSON Input, you can just use the XML Formatter, rather than the XML Generator.
02-07-2019 08:42 PM
Thank you. As you suggested I replaced the snap XML Generator with XML Formatter in the pipeline as shown below, but I’m not getting any XML output at XMLFormatter except some meta data like content-type etc… but I see JSON data at JSONParser.
REST GET → JSON Formatter → JSON Parser → XML Formatter
02-07-2019 09:23 PM
If you don’t need a wrapping root element (which also includes a metadata element), leave the “Root element” property value empty and if your input JSON is compatible, the appropriate XML will be generated.
02-08-2019 05:45 AM