-2

Possible Duplicate:
Java implementation of JSON to XML conversion
Simplest method to Convert Json to Xml

I want to change this json to xml, I don't know how to create xml for the same, please someone show me some code how can I change this json to xml:-- json code is:-

  {
     "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"
     }]
 }
Community
  • 1
  • 1
user1369219
  • 39
  • 1
  • 4
  • 1
    Have a look at http://stackoverflow.com/questions/559296/java-implementation-of-json-to-xml-conversion – John Carter Oct 10 '12 at 04:08
  • please write few lines of code only, then i can understand easily, like in above json i have two parent nodes namely - pizza,cake and i have child attributes under these nodes,just show me if i want to write this code into xml file how i need to write,thanks – user1369219 Oct 10 '12 at 04:20

1 Answers1

0

I found this online converter via google. Hope it helps

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

once converted add doc at the beginning and /doc at the end with the brackets.

On the second line include some type of .css format to display the xml and presto :)

NoNo
  • 315
  • 1
  • 4
  • 13