OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: List of differences between XML and JSON?

Below is a fantastic response from Walter Perry. Thank you Walter!  (Walter gave me permission to forward his message to the list)


The fundamental semantic premise of XML markup is the "hasA" relationship; that of JSON is "isA". This is the opposite of what one is likely to see at first blush, and it has taken me a full 20 years to understand how the syntax of XML enforces the "hasA" view, ultimately to the exclusion of "isA".

Sparing the 20-year learning curve: the XML syntax permits only the expression of "hasA" relationships between entities--even where those 'entities' are expressed in the XML attribute syntax (color=blue means only that the enclosing entity *has* an identified color and that that color *has* the identified value 'blue'). The Generic Identifier itself of an XML entity expresses no more than that the entity *has* an identified label, and specifies its instance value. The axes of XSL are those along which the XML syntax permits the semantics of identified "hasA" relationships to be expressed.

On the other hand, the semantically flat model of JSON allows the existence of anything to be naively induced if only it has a name:  use 'color' as a JSON name and presto, color exists as a nominal thing--and not merely as a Platonic form, but something immediately capable of instantiation in the real world as 'blue', 'red' or 'green'. Further, that color thing is implicitly global in scope, which is only another way of saying that the existence conferred upon 'color' by the "isA" semantic premise of JSON is an absolute existence. By contrast, such existence as we might posit for entities expressed in the XML syntax is contingent and scoped, and dependent ultimately on our willingness to make the leap of inductive reasoning required to conclude that we have a sufficient number of specific "hasA" relationships from which we may imagine a generic "isA" that types them.

This is why JSON cannot have meaningful namespaces:  semantics which rely on the primacy of "isA" do not then permit that existence to be scoped and made contingent upon "hasA" relationships. And--whatever one might think of the specific W3C-anointed syntax for XML namespaces--the semantics expressed through the XML syntax are the very essence of namespacing. Every XML entity is, or is potentially, both containing and contained by "hasA" relationships. It's namepaces all the way down--which is to say, scoped and contingent existence.


Walter Perry

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS