CodePudding user response:
Org. Json this library can realize conversion, maven depends on the following:Use:
/* *
* the XML to json string
* @ param XML
* @ return
*/
Public String xmlToJson XML (String) {
String ret=null;
JSONObject obj=XML. ToJSONObject (XML);
If (obj! Ret==null) obj. ToString ();
return ret;
}