org.json包里有一个类org.json.XML可以实现XML和JSON之间的转换。http://www.json.org/javadoc/org/json/XML.html
JSONObject json = toJSONObject("<xml><a id=\"hello\" field1=\"who\" /></xml>");
System.out.println(json.toString());
System.out.println(XML.toString(json));
org.json包里有一个类org.json.XML可以实现XML和JSON之间的转换。http://www.json.org/javadoc/org/json/XML.html
JSONObject json = toJSONObject("<xml><a id=\"hello\" field1=\"who\" /></xml>");
System.out.println(json.toString());
System.out.println(XML.toString(json));