James Clark on JSON vs. XML
April 9, 2007
James Clark on JSON vs. XML:
It’s not surprising that XML is unappealing to a generation of programmers who are coming to it fresh, without making allowances for how it got to be this way.
I’m too old to be part of this generation, but the same can be said for a whole lot of technologies, including Java, J2EE, Web services … what may have been a good excuse for their warts when they were new is often not convincing anymore today.
Another nice quote:
A range of powerful supporting technologies have been developed for XML. Naturally I have a fondness for the ones that I had a role in developing: XPath, XSLT, RELAX NG. I also can see a lot of value in XPath2, XSLT2 and XQuery. On some days, if I’m in a particularly good mood and I try really hard, I can see value in XSD.
The one thing I don’t happen to agree with (he writes this with regards to JSON):
Some important datatypes are missing. In particular, I think support for binary data (XSD base64Binary or hexBinary) is critical.
What’s the use case that can’t be solved by just referencing the binary content, preferably using some widely known way to identify things?
About
This page contains a single entry from Stefan Tilkov's Random Stuff posted on April 9, 2007 10:23 PM. The previous post in this blog was Blogger's Code of Boring Irrelevance. The next post in this blog is On Slides. Many more can be found on the main index page or by looking through the archives.
Comments
The one that pops to mind is encrypted content. Still, Base64 is just a special case of a string, and as you mentioned, for some things (especially large binary objects), you’ll probably be better off handing off a link and using HTTP to retrieve it.
Posted by: Gordon Weakliem at April 10, 2007 12:08 AM | link
What’s one case when referencing doesn’t help? Packaging. The receiver endpoint may not be able/willing to resolve (arbitrary) URIs, or network may be unavailable at time of processing.
Gordon, check http://www.w3.org/TR/xop10/ for a way of optimizing the base64 away from XML.
Posted by: Jacek at April 10, 2007 11:18 AM | link
One thing I forgot - one can sometimes also use URIs from the data: scheme - base64 supported, any media type, data right there in the URI.
Posted by: Jacek at April 10, 2007 11:21 AM | link
Sometimes a fresh set of eyes is just the thing needed…
Posted by: Dave Smith at April 12, 2007 2:26 AM | link
