如何将Json转换为xml
我的json看起来像这样
{
"udtList": {
"udt": [
{
"id": "1004",
"subItem": "1",
"Amount": "2000.0"
},
]
} }
<?xml version="1.0" encoding="UTF-8" ?>
<udtList>
<udt>
<id>1004</id>
<subItem>1</subItem>
<Amount>2000.0</Amount>
</udt>
</udtList>
答案 0 :(得分:0)
JSONObject json = new JSONObject(str);
String xml = XML.toString(json);