可能重复:
Java implementation of JSON to XML conversion
Simplest method to Convert Json to Xml
我想将此json
更改为xml
,我不知道如何为此创建xml
,请有人向我展示一些代码如何更改此json
1}}到xml
: -
json
代码为: -
{
"pizza": [{
"title": "Pizza Item 1",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit",
"cost": "$0.00",
"imageUri": "http://www.pizzahut.com.au/images/menu/Pizza-Lge-BBQ_Meatlovers.png"
}, {
"title": "Pizza Item 2",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit",
"cost": "$0.00",
"imageUri": "http://www.pizzahut.com.au/images/menu/Pizza-Lge-BBQ_Meatlovers.png"
}],
"cake": [{
"title": "Cake Item 1",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit",
"cost": "$0.00",
"imageUri": "http://www.allindiaflorist.com/imgs/cake4.jpg"
}, {
"title": "Cake Item 2",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit",
"cost": "$0.00",
"imageUri": "http://www.allindiaflorist.com/imgs/cake4.jpg"
}, {
"title": "Cake Item 3",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit",
"cost": "$0.00",
"imageUri": "http://www.allindiaflorist.com/imgs/cake4.jpg"
}]
}
答案 0 :(得分:0)
我通过谷歌找到了这个在线转换器。希望它有所帮助
http://jsontoxml.utilities-online.info/
一旦转换添加 DOC 在开头和/ doc结尾用括号。
在第二行包含某种类型的.css格式来显示xml和presto:)