Activity › Forums › Salesforce® Discussions › JSON vs XML in Salesforce
Tagged: JSON, Salesforce Development, XML
-
JSON vs XML in Salesforce
Posted by Kumar on December 14, 2016 at 11:42 AMHi everyone,
Why is JSON preferred over XML for data migration? I read somewhere that JSON is lighweight as compared to XML, but what does that mean exactly? Anyone with suggestions.
Thanks
Parul replied 7 years, 7 months ago 4 Members · 3 Replies -
3 Replies
-
Hi Kumar,
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
Con:Relatively wordy compared to JSON (results in more data for the same amount of information).
Hope this helps you.
Thanks
- [adinserter block='9']
-
Hi
Adding some points:
Extensible Markup Language (XML) used to be the only choice for open data interchange. However, developments in open data sharing have introduced more options for developers, each with their own set of benefits. While XML may be a widespread method for API integration, that doesn’t mean it’s the best choice for your project.
JavaScript Object Notation (JSON) is one alternative that’s attracting a lot of attention. The first thing that comes to mind when you mention JSON to developers is that it’s lightweight compared to other open data interchange options. However, that’s not the only reason you should use it for your next RESTful API integration. Consider these features.
Thanks
Log In to reply.
