[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: List of differences between XML and JSON?

  • From: Amelia A Lewis <amyzing@talsever.com>
  • To: xml-dev@lists.xml.org
  • Date: Thu, 30 Apr 2015 10:53:35 -0400

Re:  List of differences between XML and JSON?
On Thu, 30 Apr 2015 14:23:27 +0000, Costello, Roger L. wrote:
> -          XML supports processing instructions, JSON does not.

Entities and notations, as well. Not sure which, if any of these, are 
actually interesting in JSON context.

> -          XML provides multiple syntaxes to express things (e.g., 
> attribute values can be delimited by either a single or double quote, 
> attributes can be in any order), JSON does not have such flexibility.

Child nodes in XML (text, elements, comments, PIs) have implicit 
sequence. Outside of canonicalization, attributes and namespaces may 
appear in any order, but must be unique. One can argue that JSON 
primitive values (null, boolean, number, string) are more "like" XML 
attributes than "like" XML child elements.

> -          XML uses canonicalization to convert the XML into a 
> standard form, JSON does not need canonicalization since multiple 
> forms are not allowed.

Uh. Since ordering doesn't exist, you'd have an interesting time making 
that argument to someone writing a standard for digitally signing JSON. 
With no canonical order, there's no standard byte stream. Similarly for 
spaces and CR/LF variations.

> -          XML has namespaces, JSON does not.

Win for JSON.

Also: JSON has arrays, which XML does not (they can be simulated, 
though the choice of technique for simulation may restrict things like 
nested arrays). JSON objects inside arrays have position, but no name 
(if the array is inside an object, then the name could be mapped from 
the keyname for the array member); JSON arrays inside arrays inside an 
object are somewhat more of a challenge.

Once you enter the world of DTD or schema, versus json-schema, there 
are additional capability distinctions. I'm not clear on what's 
important about this list of differences. *Is* it capabilities? 
Appearance? Something else? If we include concepts from DTD, XML has 
ID, lists, and so on (and see above on notations and entities).

XML has pointy brackets, JSON has curly and square ones. Whee.

Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.com
The Bible contains six admonishments to homosexuals and three hundred 
sixty-two admonishments to heterosexuals.  That doesn't mean that God
doesn't love heterosexuals.  It's just that they need more supervision.


[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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.