Making a difference by processing JSON as XML
Robin La Fontaine
Anyone who has ever published more than one version of a document can readily understand the benefits of tracking changes within it. Systems and APIs that exchange JSON haven’t typically been able to take advantage of such tracking, though the problems of changing JSON structures are essentially the same as in XML. This paper looks beyond JSON Patch (a fine specification as far as it goes) to a more general mechanism for representing changes in JSON, one that includes the context of the changes so that new ways of processing change can be supported. Along the way, it introduces a loss-less, bi-directional transformation from JSON to XML, making the more mature XML processing infrastructure available to JSON developers. The best of both worlds.