One of our ERP partners asked an interesting question the other day. He asked if he should start developing his maps to be sent in JSON instead of XML. He felt that JSON was more popular than XML. That started us thinking about this as we have been asked to do a lot of XML mapping lately, but not much JSON.
According to Wikipedia, XML (Extensible Markup Language) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. It is defined by the W3C’s XML 1.0 Specification and by several other related specifications, all of which are free open standards.
So why use one over the other? A number of posts can be found on the web touting the advantages of JSON over XML. One post calls JSON the “fat-free” alternative to XML due to its smaller grammar set (it is less verbose). JSON also maps more directly onto the data structures used in modern programming languages.
Both XML and JSON are used in Ajax techniques. Ajax is a term for the ability of a webpage to request new data after it has loaded into the web browser, usually in response to user actions on the displayed webpage. As part of the Ajax model, the new data is usually incorporated into the user interface display dynamically the moment it arrives back from the server. For example, when the user is typing into a search box, client-side code sends what they type to a server that will respond with a possible list of items from its database. These might be displayed in a drop-down list beneath the search box. The user may then stop typing and select the relevant string directly. When it was originally implemented, Ajax commonly used XML as the data interchange format. Now many developers use JSON to pass the Ajax updates between the server and the client as it is faster and more efficient.
Numerous ERP packages (Oracle for example) currently use XML for importing and exporting integration data. Making a change to using JSON would take a lot of time and effort on their part.
So while the popularity of JSON is high (we have never heard anyone say they really like XML), XML is still used more than JSON. However, to keep current, we all need to know both as JSON is being used by many developers when creating APIs and data exchange sets.
We would be interested in hearing from you if you have some thoughts in this area.
Learn more about the relationship between ERP providers and EDI partnerships in our free whitepaper: EDI Partnerships Deliver Value to ERP Solutions Providers