xml字符串转JSONObject 对象

public static JSONObject xmltoJson(String xmlString){
     JSONObject obj=new JSONObject();
     XMLSerializer xmlSerializer=new XMLSerializer();
     String resulStr=xmlSerializer.read(xmlString).toString();
     object =JSONObject.parseObject(resulStr);
     return object;
}

 

posted @ 2020-05-12 15:46  pengchengcheng  阅读(2677)  评论(0编辑  收藏  举报