The question is better to use?
In ajax, I use JSON and honestly I don’t understand why then XML?
What are the global differences apart from building ???
Pros, cons.
- stackoverflow.com/questions/3536893/… habrahabr.ru/post/31225 - Costantino Rupert
- 3Most often it is better to use JSON, even where, it would seem, you can't do without XML, you can still use JSON with a little brains. Personally, my opinion about XML as a format is a lack of talent. - Zowie
- one@AlexWindHope, why mediocrity? - Salivan
- 2@AlexWindHope, unfortunately, I can not agree. XML data is perfectly readable by a person who is able to read and is not disabled ... but I still don’t agree more about the rules for constructing documents. See [ Well-Formed XML Doc ] [1] [1]: w3schools.com/xml/xml_dtd.asp - Salivan
- 3> I can not agree. XML data is perfectly read by a person is not true. XML is generally unreadable, tags and data all merge. > you cannot check the type of an object with an ordinary Jason, It depends on what is meant by type. Unlike XML, JSON has built-in float, int types. > there are no schemes and in short, read the mat.part .. =) There are schemes, just their description has not yet come out of a draft: http://json-schema.org/ Already now there are libraries that can check the conformity of the data to the scheme. - Vladimir Gordeev
3 answers
Previously, there was no JSON
, they used XML
, now many technologies support it as an alternative, many open API
also provide information in XML
. Here you have an article on this issue: JSON and XML. What's better? . The author spoke in detail about the differences in JSON
and XML
.
UPD: With a link late ..
I work in support of banking software. It's all on xml. For the interaction of various services used SOAP-protocol. On the transition to JSON, even there are no thoughts.))) My opinion is to use what answers the tasks. If you see a solution with JSON, do it with JSON. This is easier to work on the client. If the task requires XML, use XML. For example, interaction with an external system through SOAP.
The fact is that it happened historically. The XML format was introduced by Microsoft and they immediately began to shove it into all their crafts. Moreover, as the pinnacle of creative thought. With all, it would seem, its "universality", it is very cumbersome to implement working with him and a very redundant format. The craft that the small-scale ones didn’t even bother to, at least somehow, properly comprehend and realize. JSON is a more compact and understandable format.