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


  • From: Takuki Kamiya <tkamiya@us.fujitsu.com>
  • To: "Peintner, Daniel" <daniel.peintner.ext@siemens.com>, Mukul Gandhi<gandhi.mukul@g...>, "xml-dev@l..." <xml-dev@l...>
  • Date: Thu, 5 Oct 2017 15:57:18 -0700

RE:  Re: XML vs JSON



In addition, it may be worth mentioning that a draft version of WoT (Web of Things) Thing Description [1]

specification also attempts to define JSON-schema to XML-schema mapping, based on the JSON-XML

mapping defined by EXI.


One consequence of this is one will be able to validate JSON documents based on JSON schema

using existing XML schema processors of user’s choice.


[1] https://www.w3.org/TR/2017/WD-wot-thing-description-20170914/#mapping-to-xml-schema


Takuki Kamiya



From: Peintner, Daniel [mailto:daniel.peintner.ext@siemens.com]
Sent: Thursday, October 05, 2017 2:07 AM
To: Mukul Gandhi <gandhi.mukul@g...>; xml-dev@l...
Subject: AW: Re: XML vs JSON



Many of these JSON<->XML tools provide a good coverage for some XML/JSON constructs but not for all.

The tool [1] you pointed to fails for example when converting the following "simple" JSON example to XML.

{ "a number": 1 }

The reason is rather simple. The qualified name in XML has some restrictions that are more rigid than the JSON fieldnames.

Hence, we in the EXI working group worked on a more sophisticated approach when converting JSON to XML infoset [2]. This requires escaping as shown here [3] for the example above.

Note1: The Efficient XML Interchange (EXI) format would not have the same restrictions as XML but the working group concluded that any EXI document should be convertible to XML.

Note2: The XSLT working group uses yet another scheme [4] which for EXI did not work given that we want to allow for user-defined XML schemas.

Having said that, there seem to be many approaches and solutions,

-- Daniel

[1] www.utilities-online.info/xmltojson/
[2] https://www.w3.org/XML/EXI/docs/json/exi-for-json.html
[3] https://www.w3.org/XML/EXI/docs/json/exi-for-json.html#exampleKeynameEscaping
[4] https://www.w3.org/TR/xslt-30/schema-for-json.xsd



Von: Mukul Gandhi [gandhi.mukul@g...]
Gesendet: Freitag, 22. September 2017 08:08
An: xml-dev@l...
Betreff: Re: XML vs JSON

With respect to this thread, I could see that people have written tools to convert between XML and JSON (both ways). This seems to be nice: www.utilities-online.info/xmltojson/


On 1 August 2017 at 17:04, Mukul Gandhi <gandhi.mukul@g...> wrote:


    I don't intend to spark a bitter debate between XML & JSON, where the outcome of debate is win of one over other. Rather, I wish to present in a friendly manner, according to me, where these two technologies differ.


When talking about designing REST services, JSON seems to clearly win. The whole software world seems to be biased in favour of JSON it seems, for this criteria. Although I have read, that in many cases REST services can use XML instead of JSON. I think, JSON's major use case is in the use within REST.


Having worked quite a bit with Android mobile apps, that framework by default relies heavily on XML. I haven't seen JSON being used by default in that area. Although, JSON is many times used in feeding and fetching JSON data from various kinds of services (remote REST services, local API calls etc), in Android apps.


XML when considering other technologies in combination, like XML Schema and XML databases, have a scale close to RDBMSs. JSON is no where near this.


Any other thoughts from the experts here?





Mukul Gandhi

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


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.
First Name
Last Name
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.