Robert Haas wrote:
One subtle point that isn't documented and probably should be is that
JSON can't support a container that behaves partly like a list and
partly like a hash, as XML can.  So for example in XML a <Plan> tag
could have children like <Startup-Cost> (one each) and could also have
its inner, outer, and sub-plans in there as <Plan> tags right under
the parent <Plan>.  I'm not sure this would be good design anyway, but
it COULD be done.  In JSON, this will crash and burn, because the
container is either an array (which precludes labelling the elements)
or a hash (which precludes duplicates).



Right, this is fairly well known, I think. There are methods to map XML to JSON, and it can even be done in such a way that you can make a complete round trip, but in the schemes I've seen the JSON doesn't really look like what you would use if you designed the JSON document from scratch, or if it does then you're losing something.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to