Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

json vs xml

what are differences between json and xml. what are advantages, disadvantages of each

I read like below
JSON uses typed objects. All XML values are typeless strings and must be parsed at runtime
what it mean by typed object and typeless strings and runtime parsing

please advise
SOLUTION
Avatar of ethoths
ethoths

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ethoths
ethoths

Ditto
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just again: JSON represents an object. XML is only data.
JSON objects are DTOs, so only data too. From the json.org "JSON (JavaScript Object Notation) is a lightweight data-interchange format"

So json object are no more objects than their XML counterpart. The difference between the two is simply syntax. You can even write some XSLT to transform the XML to json they are that similar.

Json is used very widely in restful services whereas XML tends to be used in traditional RPC web services.

If you are free to choose, I'd go with json as it is now more widely used and the tooling is maturing. It is more easily consumed by browsers and has a lower bandwidth requirement.

Technically, anything you can do with one can be done with the other. In some circumstances one will be easier than the other - it all depends on who your consumer is.
Sorry ste5an,

Json is just formatted data.
XML is a markup language.

I even use a XML script-language in our ESB to create Webservices.
I propose to divide the points evenly
There is not a right or wrong answer on a "what are differences" question