Activity Forums Salesforce® Discussions Why must one use JSON over XML in Salesforce?

  • madhulika shah

    Member
    August 7, 2018 at 1:45 pm

    Hello Prachi,

    Comparison between JSON and XML is given below:

    1. Simplicity: XML is simpler than SGML, but JSON is much simpler than XML. JSON has a much smaller grammar and maps more directly onto the data structures used in modern programming languages.
    2. Extensibility: JSON is not extensible because it does not need to be. JSON is not a document markup language, so it is not necessary to define new tags or attributes to represent data in it.
    3. Interoperability: JSON has the same interoperability potential as XML.
    4. Openness: JSON is at least as open as XML, perhaps more so because it is not in the center of corporate/political standardization struggles.

    These are the reasons why one must use JSON over XML.

  • Parul

    Member
    September 28, 2018 at 5:26 pm

    JSON
    Pro:

    Simple syntax, which results in less “markup” overhead compared to XML.
    Easy to use with JavaScript as the markup is a subset of JS object literal notation and has the same basic data types as JavaScript.
    JSON Schema for description and datatype and structure validation
    JsonPath for extracting information in deeply nested structures
    Con:

    Simple syntax, only a handful of different data types are supported.

    XML
    Pro:

    Generalized markup; it is possible to create “dialects” for any kind of purpose
    XML Schema for datatype, structure validation. Makes it also possible to create new datatypes
    XSLT for transformation into different output formats
    XPath/XQuery for extracting information in deeply nested structures
    built in support for namespaces

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos