locked
Advantages of JSON over XML RRS feed

  • Question

  • User1904516115 posted

    What are the advantages of JSON over XML?

    Thursday, March 22, 2018 4:04 PM

All replies

  • User-474980206 posted

    there are a couple advantages:

    1) usually smaller in length
    2) defecto standard for REST api's
    3) easier for humans to read (thus the switch to JSON config files)
    4) easier for deserialization/serialization (especially javascript - builtin support)
    5) REST api's don't require an XSD file
    6) simplicity of REST api's over SOAP

    Friday, March 23, 2018 1:23 AM
  • User-707554951 posted

    Hi vinodkpasi

    JSON is more compact and can be easily loaded in JavaScript.

    XML is stricter and has support for schemas and namespaces.

    On the face of it JSON seems superior in every way - it's flexible, more compact and in many cases easier to use (especially when working with JavaScript), however it lacks some key features, in particular:

    Schema support,

    I.e. the ability for party A to specify the format of a document, and the ability for party B to check that they are supplying something that matches this format.

    This is crucial when passing data between separate systems, where a deviation from the expected format might mean that the data cannot be processed (or worse, is processed incorrectly).

    Namespace support,

    I.e. the ability to mix data intended to be read by multiple sources (or written by multiple sources) in the same document.

    https://www.quora.com/What-are-the-advantages-of-JSON-over-XML

    https://www.quora.com/What-are-the-advantages-of-JSON-over-XML

    https://dzone.com/articles/why-you-cloud-be-using-json-vs-xml

    Best regards

    Cathy

    Friday, March 23, 2018 1:58 AM