Blog Post

XML-> JSON document Example

,

Convert the XML document to JSON document example

<person>
  <name>John</name>
  <age>25</age>
  <address>
    <city>New York</city>
    <postalCode>10021</postalCode>
  </address>
  <phones>
    <phone type="home">212-555-1234</phone>
    <phone type="mobile">646-555-1234</phone>
  </phones>
</person>

 

{

“name” : “John”,

“age” : 25,

“address” : { “city” : “New York”, “postalCode” : “10021” },

“phones” :

[

{“phone”:”212-555-1234″, “type” : “home”},

{“phone”:”646-555-1234″, “type” : “mobile”}

]

}

You can also use a converter utility to get the required output.

http://codebeautify.org/xmltojson

 

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating