Member since
05-05-2017
15
Posts
0
Kudos Received
0
Solutions
03-16-2018
03:29 AM
Hi @Ward Bekker I am trying the same code but getting error : Code is below one , could you let me know what is wrong, I have added dependency as well. import net.sf.json.JSON import net.sf.json.JSONObject import net.sf.json.JSONSerializer import net.sf.json.xml.XMLSerializer String str = '''{ "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } }'''JSON json = JSONSerializer.toJSON( str ) XMLSerializer xmlSerializer = new XMLSerializer() xmlSerializer.setTypeHintsCompatibility( false ) String xml = xmlSerializer.write( json ) print(xml)
... View more