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

Re: Best options for converting JSON to XML

  • From: Michael Kay <mike@saxonica.com>
  • To: Hermann Stamm-Wilbrandt <STAMMW@de.ibm.com>
  • Date: Sat, 9 Nov 2013 17:23:51 +0000

Re:  Best options for converting JSON to XML
With specific relevance to the requirement for XSD validation, one of the main differences between different JSON-to-XML mappings is whether JSON keys end up mapping to element names or to data values (typically attribute values): does {'colour':'red'} become <colour>red</colour>, or <pair key="colour" value="red"/>?

The trouble with mapping keys to element names is that a key can be any string, and not all strings are valid element names. But XSD validation is strongly driven by element names, so if you map keys to attribute values, it's going to be hard to define the constraints in XSD.

Michael Kay
Saxonica


On 9 Nov 2013, at 16:56, Hermann Stamm-Wilbrandt <STAMMW@de.ibm.com> wrote:

> Hi,
> 
> there was no standard for JSON2XML conversion (and back) in 2009.
> DataPower appliances needed that, as well as DB2.
> So an IBM internal JSONX standard was created.
> 
> Later it was submitted but did just expire in November 2011:
> http://tools.ietf.org/html/draft-rsalz-jsonx-00
> 
> Here is an example:
> http://pic.dhe.ibm.com/infocenter/wsdatap/v3r8m1/index.jsp?topic=%2Fxb60%2Fconvertingbetweenjsonandjsonx07.htm
> 
> There are many other ways to represent JSON in XML, each with different set
> of positive/negative features.
> 
> 
> Mit besten Gruessen / Best wishes,
> 
> Hermann Stamm-Wilbrandt
> Level 3 support for XML Compiler team and Fixpack team lead
> WebSphere DataPower SOA Appliances
> https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/
> https://twitter.com/HermannSW/     http://www.stamm-wilbrandt.de/ce/
> ----------------------------------------------------------------------
> IBM Deutschland Research & Development GmbH
> Vorsitzende des Aufsichtsrats: Martina Koederitz
> Geschaeftsfuehrung: Dirk Wittkopp
> Sitz der Gesellschaft: Boeblingen
> Registergericht: Amtsgericht Stuttgart, HRB 243294
> 
> 
> 
>  From:       Ihe Onwuka <ihe.onwuka@gmail.com>                                                                                       
> 
>  To:         "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>,                                                                        
> 
>  Date:       11/09/2013 05:25 PM                                                                                                     
> 
>  Subject:     Best options for converting JSON to XML                                                                       
> 
> 
> 
> 
> 
> 
> I am considering alternatives to JSON Schema for validating JSON so
> the natural idea is to convert to XML and use some sort of schema.
> 
> I'd be grateful for thoughts on the advisability of this type of
> thinking in the first place and suggestions for converting the JSON to
> XML.
> 
> thanks
> 
> _______________________________________________________________________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
> 
> 
> 
> 
> 
> _______________________________________________________________________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



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