[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE: List of differences between XML and JSON?
This also explains the reason why a JSON object, similar to an XPath 3.1 map, doesn't have identity, while an XML document (or any other node) has identity. This makes a JSON object / map more efficient and easier to manipulate. Remember that the identity rule (overridden to introduce some modifications in the result, compared to the original XML document) is by its complete-rewriting nature O(N). At the same time, with a good map implementation producing a modified map from an existing one can take O(log2(N)) or less. Cheers, Dimitre On Fri, May 1, 2015 at 12:43 PM, Costello, Roger L. <costello@mitre.org> wrote: > 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. > > Respectfully, > > Walter Perry
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|