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

Re: #Announce published JXML schema, an XML schema forreprese

  • From: John Cowan <cowan@mercury.ccil.org>
  • To: Michael Kay <mike@saxonica.com>
  • Date: Thu, 3 Feb 2011 12:31:24 -0500

Re:  #Announce  published JXML schema
Michael Kay scripsit:

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

xs:boolean is a rather irritating type, a relic of the SGML days when
the cost of a document was measured in keystrokes, making "true" four
times more expensive than "1" and "false" five times more than "0".
I suppose an appropriate restriction of xs:boolean (is that even
possible?)  would be better.

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

I think the best approach is to directly represent every character
except #x0-#x8, #xB-#x1F, \, #xFFFE, and #xFFFF, and escape them with
JSON escaping.

A disputed case is escaped unpaired surrogates in JSON strings: is
"a\ud800b" is a valid JSON string?  Crockford says it's valid, following
the model of JavaScript strings, which are really sequences of arbitrary
integers between 0 and 65535.  I say that RFC 4627 rules them out, saying
"A string is a sequence of zero or more Unicode characters", even if
Crockford did not intend that interpretation when he wrote the RFC.

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

Sounds like a good idea to me.  The IBM DataPower convention is pretty
good too: it does not have a "member" element, but instead puts the
name associated with each value of an object in @name of the object
itself, thus:

JSON:  {"answer" : 43}

xmlsh:  <object><member name="answer"><number>43</></></>

DataPower: <object><number name="answer">43</></></>

-- 
I don't know half of you half as well           John Cowan
as I should like, and I like less than half     cowan@ccil.org
of you half as well as you deserve.             http://www.ccil.org/~cowan
        --Bilbo


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