将获取的json对象转换成xml数据格式

参考网址:http://blog.csdn.net/u013714419/article/details/24804337

public static void main(String[] args){

      String json="";

  JSONArray jsonObject = JSONArray.formObject(json);

  XMLSerializer xmlSerial = new XMLSerializer();

     String xml = xmlSerial.write(jsonObject);

    System.out.println(xml);

}

=-=======jar包依赖


org.json
json
20151123



xom
xom
1.2.5



commons-logging
commons-logging
1.2



net.sf.ezmorph
ezmorph
1.0.6

转载于:https://www.cnblogs.com/21heshang/p/6322938.html

你可能感兴趣的:(将获取的json对象转换成xml数据格式)