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

RE: #Announce published JXML schema, an XML schema for repres

  • From: "David Lee" <dlee@calldei.com>
  • To: "'Michael Kay'" <mike@saxonica.com>, <xml-dev@l...>
  • Date: Thu, 3 Feb 2011 11:34:47 -0500

RE:  #Announce  published JXML schema

Thanks to both online and offline suggestions,  I’ve updated the specs with the following changes (and tested my toolkit)

 

Lower case elements

Cleaned up the XSD a bit to use direct types instead of trivial restrictions.

Made null an actual empty element

 

Still thinking about the string escaping issue.   I was unaware that JSON allowed NUL values in strings, I need to ponder that.

( as well as other Unicode values unallowed in XML even as entities).

 

This is a minor piece of the framework of a much more comprehensive JSON/XML transformation project I’m working on, so should not be confused with arbitrary XML<->JSON bidirectional transformations.  That’s another beast entirely which I’m trying to tame.

 

 

Thank you all for the feedback !

 

 

 

----------------------------------------

David A. Lee

dlee@calldei.com

http://www.xmlsh.org

 

From: Michael Kay [mailto:mike@s...]
Sent: Thursday, February 03, 2011 11:00 AM
To: xml-dev@l...
Subject: Re: #Announce published JXML schema, an XML schema for representing the JSON data model

 


On 03/02/2011 14:08, David Lee wrote:

I’ve had this working for a while but finally got around to publishing the specs.

 

http://xml.calldei.com/JsonXML

 

This is currently implemented in the xml2json and json2xml commands in xmlsh (http://www.xmlsh.org)

 

The goal of this schema is a direct mapping in XML to the JSON data model,  NOT a “nice XML transformation of JSON”.

( I’m working on that separately which I hope to publish later this year).

 

This is extremely simple (intentionally) and should be easy to implemented in most languages.

 

 

 

----------------------------------------

David A. Lee

dlee@calldei.com

http://www.xmlsh.org

 


Looks good. I share John's aesthetic objections to upper-case element names.

It would be easy enough to add to the schema the constraint that the names of members in an object must be unique.

It seems rather odd that BOOLEAN should be an enumerated string rather than an xs:boolean.

It also seems odd to use trivial restrictions of xs:double and xs:string rather than using xs:double and xs:string themselves.

You get slightly better schema-aware XSLT and XQuery processing capability if you make "value" an abstract element heading a substitution group, rather than a choice group (it means you can match it using "schema-element(value)").

You need to say whether strings are held in JSON format (with backslashes) or are unescaped. You're damned if you do, damned if you don't: if you try to do unescaping then you hit the nastiness that JSON can contain \0 which can't be represented directly in XML.

We're working on parse-json() and serialize-json() for XSLT 3.0 right now. At present we're converting to new map/array data structures rather than XML trees, but this could well be an alternative.

Michael Kay
Saxonica



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