json数据转换为xml格式

网友投稿 256 2022-09-18

json数据转换为xml格式

result = ServiceUtils.invoke("component:oa-infoPortal/PortalServiceInvoker","getTodoNumForBpm", params); //json数据转换为xml格式 String str=JSON.toJSONString(result.getResult()); JSONArray jsonArray =JSONArray.parseArray(str); StringBuffer sBuffer=new StringBuffer(); sBuffer.append(""); sBuffer.append(""); for (int i = 0; i < jsonArray.size(); i++) { String str1=jsonArray.get(i).toString();JSONObject jsStr=JSONObject.parseObject(str1); sBuffer.append(""); sBuffer.append(""); sBuffer.append(jsStr.get("id")); sBuffer.append(""); sBuffer.append(""); sBuffer.append(jsStr.get("subject")); sBuffer.append(""); sBuffer.append(""); sBuffer.append(""); } sBuffer.append(""); sBuffer.append("]]>"); //return JSON.toJSONString(result.getResult());

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:spring和struts2整合的web.xml文件
下一篇:广告情报局:知乎,用十年找这个答案!
相关文章

 发表评论

暂时没有评论,来抢沙发吧~