[xquery-talk] JSON query processing

Adam Retter adam.retter at googlemail.com
Sat Oct 15 03:08:37 PDT 2011

> P.S. the first one who has the courage to say that XML and JSON should
> co-exist
> non only peacefully, but in close harmony, has all my respects. (I think so,
>  but I didn't dare to  say it publicly  :-)
> P.S. 2  If you think the opposite, that JSON  should break free from
> thousands of pages of XML specifications,
> and run ....don't be shy ! I think everybody would understand that point of
> view, too :-)

Of course! XML and JSON should co-exist, they solve different
problems! Yes there is some overlap at times where you could choose
one or the other, but usually there is a clear advantage in using the
correct one at the correct time.

However, I dont think that one should be constrained by the other. You
dont want to impose XML like specifications onto JSON because its the
wrong thing to do. You also dont want to bring JSON into XML
specifications because its the wrong thing to do. They both have their

I tend to feel that some XML folks have this feeling that 'its the end
of days' because of the growing popularity of JSON. Thats not the
case, both have their applications.

If you are working with JavaScript either client-side or server-side
and you need to push a Java object over the network or you want to
push some data into JavaScript then JSON is the way to go, regardless
of if you started with XML.

If you want to provide a human-readable document or document-set for
either content delivery, or disparate systems interoperability then
XML is the way to go. Yes there is great tooling around XML, but
perhaps that is because XML is a document format, and instead JSON is
a object notation for JavaScript. So the scope of XML, or at least the
initial design scope of XML was larger than that of JSON, sure the
boundaries are changing though...

But more interestingly surely is not whether its JSON or XML, but how
you model your data? I dont look at some data and immediately see XML,
I first consider if its tree shaped, if so then XML is probably a good
fit, its its not tree shaped then I have to ask myself, is XML still
the best fit for this?
What I am getting at is that, JSON and XML are just
serialisations/presentations/organisations of the data, at the end of
the day in your XML database or JSON database, these things are not
stored as pure-XML or pure-JSON they are converted down into bespoke
efficient binary structures either on-disk or in-memory for
processing. When these are retrieved we can deliver them as either XML
or JSON providing the original complete semantics of the data were
correctly encoded.

I think David's and others work on creating bi-directional mappings
between XML and JSON are the way to go, these are the really useful
specification and tools that we need for interoperability.

Adam Retter

skype: adam.retter
tweet: adamretter

More information about the talk mailing list