/*xom-1.1.jar JSON vs. xml conversion */
/** * json (array) string converted to XML string * (must be introduced xom-1.1.jar) * @param jsonstring * @return */ public static String Json2xml (string jsonstring) { XMLSerializer Xmlserializer = new xmlserializer (); return xmlserializer.write (Jsonserializer.tojson (jsonstring)); } /** * xml transfer json * (must be introduced Xom-1.1.jar) * @param xmlstring xml string * @return */ public static string xml2json (string xmlstring)   { xmlserializer xmlserializer = new XMLSerializer (); json json = xmlserializer.read ( xmlstring); return json.tostring (1); }
Note the jar packages to be introduced are:
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8E/1B/wKiom1i1kkvy837kAADsj-qHOoU934.png-wh_500x0-wm_ 3-wmp_4-s_3363689344.png "title=" 111.png "alt=" Wkiom1i1kkvy837kaadsj-qhoou934.png-wh_50 "/>
This article from "Jianbo" blog, reproduced please contact the author!
Conversion of XML to JSON in Java