简一_hz 2016-06-29 01:23 采纳率: 48.6%
浏览 1250

怎么将现有的这个json解析转成xml解析

下面这段json解析的代码怎么才能转成xml解析?

public boolean parse() {
Log.i(new String(reqData));
String whereByteId = "";
Cursor c = null;
File dir = new File(folder);
if (dir.exists()) {
if (!deleteDir(dir)) {
//return;
}
}
try {
dir.mkdir();
} catch (Exception e) {
}
try {
JSONArray jAReq = new JSONArray(new String(reqData));
for (int i=0; i<jAReq.length(); i++) {
String byteid = (String) jAReq.opt(i);
if (whereByteId.length() == 0) {
whereByteId = "(\'" + byteid;
} else {
whereByteId += "\',\'" + byteid;
}
}
} catch (JSONException e) {
// TODO: handle exception
Log.i(e.getMessage());
}
if (whereByteId.length() != 0) {
whereByteId += "\')";
}
`


  • 写回答

1条回答 默认 最新

  • 「已注销」 2016-06-29 06:14
    关注

    http://www.oschina.net/code/snippet_436266_11970
    如果不想写代码,可以使用在线工具

    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码