JSON or XML: Just Decide
Friday, 13 April 2012
When people create HTTP APIs, one of the common decisions is about what format to use, usually revolving around “JSON or XML?”Hi, I’m Mark Nottingham.
I usually write here about the Web, protocol design, HTTP, and Internet governance.
Find out more.
Comments? Let's talk on Mastodon. @mnot@techpolicy.social
(readers in the last ~two weeks; updated daily)
Friday, 13 April 2012
When people create HTTP APIs, one of the common decisions is about what format to use, usually revolving around “JSON or XML?”Monday, 21 January 2008
I’m following the discussion of RESTful Web description in general, and WADL in particular, with both difficulty and interest (see Patrick and Joe’s thoughts for a nice contrast).Friday, 2 November 2007
I’ve updated the WADL documentation stylesheet, primarily to;Thursday, 5 April 2007
We’ve announced the program for this years’ Developers’ Track, and I’m very excited about the lineup.Wednesday, 7 February 2007
Yahoo! (finally!) released Pipes as a beta today; congrats to the very talented team that put this together.Thursday, 30 November 2006
One of the perceived deficiencies of JSON is that it doesn’t have a schema language. I say “perceived” because the problems that a schema language brings often outweigh the benefits; after all, look at the mess that XML Schema is in.Friday, 7 April 2006
It’s become axiomatic in some circles — especially in WS-* land, as well as in many other uses of XML — that the preferred (or only) means of offering extensibility is through URI-based namespaces, along with a flag to tell consumers when an extension needs to be understood (a.k.a. mustUnderstand).Monday, 23 January 2006
I’ve been playing around with some ideas that use XMLHttpRequest recently, but I keep on bumping up against implementation inconsistencies on IE vs. Safari vs. Opera vs. Mozilla. Although the interface exposed is pretty much the same, what it does in the background is very different, especially with regards to HTTP.Tuesday, 18 October 2005
I’ve raved before about how useful the XSLT document() function is, once you get used to it. However, the stars have to be aligned just so to use it; the Web site can’t use cookies for anything important, and the content you’re interested in has to be available in well-formed XML.Monday, 5 September 2005
Feed History draft -04 is out, with the only major change being the replacement of fh:stateful with fh:incremental, with corresponding changes throughout the document, to make the concepts a bit clearer.Monday, 15 August 2005
Draft -03 of Feed History: Enabling Stateful Syndication is now available. Significant changes include:Saturday, 13 August 2005
When I worked in the financial industry, I quickly noticed that Excel spreadsheets contain the bulk of the data in the enterprise. It may make IT execs tear their hair out, but having the data nearby and ready for analysis is sloppy, but oh-so-effective. The challenge is to make the data reusable elsewhere.Wednesday, 10 August 2005
For some time, I’ve noticed that people defining XML formats spend an inordinate amount of time talking about the structure of the format. This is especially apparent in standards working groups, where hours — no, days — can be spent agonizing over whether to make something an attribute or an element.Friday, 8 July 2005
You can describe just about anything with sufficient precision in plain English, given enough words. In practice, this doesn’t happen; specialised fields — whether science, finance or art — develop specialised jargon as a shorthand for concepts that are well-understood in that field. It gives greater precision, easier flow of ideas, and yes, it raises the bar to entry for newcomers.Tuesday, 14 June 2005
Or, What’s Wrong with XInclude?Tuesday, 24 May 2005
The W3C has just started a mailing list for discussion of Web description formats;Saturday, 21 May 2005
If you accept that QNames in content are evil, the next logical question is whether XML Base is any better. In fact, if you turn your head a certain way, it appears that there’s very little difference between a default namespace and XML Base.Wednesday, 18 May 2005
Marc Hadley has released WADL in the wild, and I’m intrigued; based on a first look, I’d say it’s the most promising Web (as opposed to Web Services) description language yet.Tuesday, 17 May 2005
OxygenXML 6.0 is out, and it sucks even less. The biggest news is — finally! — a visual Schema editor. This may be the biggest threat yet to Gudge’s job security, as Human Schema Editor. :)Friday, 29 April 2005
Today’s release of Tiger includes a new but little-discussed framework for developers, CoreData. What’s most interesting to me is its similarities — and differences — to SDO, IBM and BEA’s* effort to abstract away the specifics of how data is stored.Sunday, 24 April 2005
XML is arguably one of the bigger things to come onto industry’s radar for a while, and as a result programming languages (e.g., ECMAScript, Comega, Java) are changing to accommodate it. This isn’t just happening in libraries; the syntax of the languages is changing.Friday, 1 April 2005
RDF has a simple, usable, universal model; everything’s nodes and arcs, so it avoids the problems of the Infoset, which IMO are brought by its complexity and special cases. Years of disquiet about attributes by portions of the XML cognoscenti support this view unintentionally, I think.Wednesday, 2 March 2005
So, you’ve got some data that you need to give to somebody else, and you want to use XML to do it; good for you, you’ve seen the light / hopped on the bandwagon / drunk the Kool-Aid.Tuesday, 22 February 2005
I love the XSLT document function. With it, you can access the whole Web from a stylesheet; this gives a lot of flexibility, in the right situation.Monday, 24 January 2005
I’m intrigued by the JSON effort. While many people (and vendors) have chosen XML for data interchange because it’s not platform- or vendor-specific, these folks have chosen the other path; by leveraging the serialisation of data structures in ECMAScript (nee JavaScript) — a nearly ubiquitous language, on every desktop that has a browser — they get an automatic installed base and at least one API for free.Friday, 17 December 2004
The Australian Bureau of Statistics has released a very cool SVG-based animated population pyramid ( non-SVG preview) that very nicely visualises the change in that country’s population over time. While the pyramid technique is fairly common, the addition of a fourth dimension — time — and the ability to track a cohort through it really brings the data to life. Try the “highlight surplus of males or females” feature to see when you’ve got the least competition.Thursday, 5 August 2004
(Another instalment in “XML Heresies.”)Monday, 26 July 2004
From the Daily Python URL comes another noteworthy API for XML; XMLFragment. I haven’t tried it yet (it doesn’t appear to be separately available, hint, hint), but I like the look of it.Wednesday, 23 June 2004
John Schneider was in the office last week and gave me a demo of something he’s been working on for a while, E4X — by far one of the coolest technologies I’ve seen in some time. I think that every language is going to want one when they see this stuff.Friday, 28 May 2004
I’ve been talking with a few people about my previous assertion that the Infoset is a bad abstraction for data modelling, and my subsequent post about the informational properties of the Infoset.Wednesday, 12 May 2004
Recently, I’ve been thinking about the influences that using the Infoset has on the information you place in it.Tuesday, 11 May 2004
I’ve been playing around with the new OxygenXML 4.0 plug-in for Eclipse M8.Friday, 7 May 2004
To help inform discussion of XOP (and to save Sam the trouble ;), I’ve put together a quick-and-dirty (we’re talking two hours) XOP parser in Python. It isn’t particularly efficient, nor is it well-tested or robust; it’s only to demonstrate how a XOP parser might behave.Wednesday, 5 May 2004
Without pointing fingers, some people have a bee in their collective bonnet about the dangers of allowing binary content to be represented in XML, care of XOP. Others are up in arms about re-inventing HTTP in SOAP, courtesy of the Representation Header. Both of these are products of the XML Protocol WG, of which I’m a member, so I’d like to share my viewpoint (which is not that of either my employer nor the working group, etc., ad nauseam).Friday, 9 April 2004
This is a good idea for so many reasons. The media type registration will have to be changed to take advantage of it, but I believe that RFC3023 is under review anyway.Sunday, 7 March 2004
An interesting issue poked its head up at the W3C Technical Plenary last week. XML Protocol (known as SOAP to mere mortals) is defined in terms of XML Infosets — it describes how to move Infosets around and process them, as the basis of Web services.Saturday, 7 February 2004
One of the uglier corners in the Web architecture is the relationship between fragment ids (the bit of the URI at the end, after the “#”) and content negotiation. In a nutshell, because dereferencing a single URI can return multiple formats, and because the fragID is interpreted by the client based on the format, it’s possible to have a fragID mean wildly different things across representations of a single resource.Monday, 12 January 2004
There’s a lot of interest out there about exposing XQuery 1.0 / XPath 1.0 / XPath 2.0 in Web interfaces. On the face of it, this is quite a compelling idea; it allows you to reuse a generic query mechanism (goodness) to access arbitrary data based on the client’s needs (more goodness) and only the bits of data that you want go across the wire (yet more goodness).Wednesday, 26 November 2003
I’m getting a few requests for clarification and additional information from 3rd party vendors regarding my previous rant on XML editing. With any luck, XML editing will get much more interesting soon…Thursday, 2 October 2003
I’m seriously sick of using programs that call themselves “XML editors” because they colourize markup. I’m talking about XML Spy, Oxygen, BBEdit, and thousands of lesser programs. All of them are just glorified text editors - they still operate on the level of characters, not information items.Saturday, 14 June 2003
Sean McGrath, Macintouch and others point out OxygenXML, a pretty slick-looking XML editor. Either it’s pretty new and only now coming onto the scene, or I’ve had my head deeper in the sand than is typical.