XML and JSON: horses for courses or a one-horse race?

Both XML and JSON are now well established, but there is inevitably still a decision to be made as to which is best – or can we manage with only one of them? To me, as an engineer with a heavy exposure to structured data particularly in data interchange, it has been interesting to see these two develop.

Why we have XML and JSON

It is worth remembering that XML, when it appeared in 1998, was a very significant simplification of its parent SGML. SGML was well-used in publishing but the entry cost was high due to its complexity. XML appeared as a 20 page specification which ruthlessly eliminated many of SGML complexities – but many thought it still too complex. So JSON was born to be simple and easy to use.

It is always attractive to make things simpler, and we all applaud that trend. The problem though with simplicity can be a lack of power and flexibility and sometimes the simple solution soon sprouts many add-ons to meet these needs. We see it in other areas, for example Scheme was a simple version of Lisp but to use it in earnest you needed to access additional libraries of functions. But, like JSON, it was an appropriate solution to many problems.

How do we choose?

So how do we approach any choice between XML and JSON? I view XML as a run of text with markup added to provide computer-sensible semantics. I view JSON as data structure with string and number values added at the appropriate places. Therefore as a document contains more data, e.g. a catalogue, then the best representation might move from XML to JSON. Similarly as a set of, for example, financial data gains more explanatory text to become an annual report, so the most appropriate structure might change from JSON to XML.

Our interest is in finding change to data or documents in both these formats and the challenges have similarities and differences. XML is inherently an ordered sequence of information, JSON objects all have named members where the order is not relevant. So we find that we need a different approach to get the best results from each. The good news is that discovering the best approach to one leads to improvements in the other. So certainly we need them both!


Try a 30 day free professional trial of DeltaJSON today →

Keep Reading

Everything Great About DeltaJSON

/
Accessible through an intuitive online GUI or REST API, DeltaJSON is the complete package for managing changing JSON data. Learn everything about makes DeltaJSON great.

Simplifying Your JSON Management Experience with DeltaJSON

/
DeltaJSON simplifies JSON data management with the introduction of an NPM package.

Cyber Resilience for SMEs: A Chat with DeltaXML’s Systems Administrator

/
Peter Anderson, IT System Administrator, relays the importance of cyber resilience for SMEs.

S1000D and Beyond: Navigating the Skies of Aviation Data with XML

/
This blog explores the significance of XML in aviation data management, highlighting standards like S1000D.

File Formats and ConversionQA Functionality

ConversionQA is a tool by DeltaXML ensuring the success of content conversion projects by comparing content from any two XML formats.

Introducing ConversionQA

ConversionQA is introduced as a solution to comparing content across different XML formats, addressing scenarios like content conversion and restructuring documents.

Making Tax Digital: Embracing XML Technology for HMRC Compliance

The Making Tax Digital (MTD) initiative by HMRC aims to digitise the UK tax system, but what does that mean for UK businesses?

Best Practices for Managing XML Configurations in System Administration

Effective management of XML configurations is crucial for system administrators.

The Crucial Role of XML and JSON in Modern Air Traffic Control Operations

XML and JSON play a crucial role in modern air traffic control, facilitating efficient systems.