-2

可能重复:
JSON 到 XML 转换的 Java 实现
将 Json 转换为 Xml 的最简单方法

我想将其更改jsonxml,我不知道如何创建xml相同的,请有人告诉我一些代码如何将其更改jsonxml:-- 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"
     }]
 }
4

1 回答 1

0

我通过谷歌找到了这个在线转换器。希望能帮助到你

http://jsontoxml.utilities-online.info/

转换后,在开头添加 doc,在末尾添加 /doc,并用括号括起来。

在第二行包括某种类型的 .css 格式来显示 xml 和 presto :)

于 2012-10-10T04:20:54.323 回答