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

Re: [xquery-talk] MarkLogic using JSONiq for processing JSON ?

  • From: Michael Kay <mike@saxonica.com>
  • To: daniela florescu <dflorescu@me.com>
  • Date: Fri, 8 May 2015 12:09:05 +0100

Re: [xquery-talk] MarkLogic using JSONiq for processing JSON ?
> 
> So, to me,  the decisions of the W3C working group seems random, and rather based on a two years old
> kind of a  tantrum “I WANT TO BE DIFFERETENT JUST BECAUSE…..I WANT IT."
> 
> 
> ……...rather then justified by any technical reasons.
> 

No, all the arguments were all technical. For example:

* generalizing maps to allow any atomic type as the key, rather than only a string, was because of specific use cases that required this (remember that the first proposal to add maps to XDM came from XSLT streaming work, not from JSONiq)

* the decision to use “map{…}” rather than “{…}” was to some extent subjective, but was motivated by technical arguments such as the ability to produce good error messages, retaining options for future extensions to the grammar, etc. Expressions beginning with “{“ are particularly problematic because “{“ is used to delimit embedded expressions in element content, and “{{“ is used to escape “{“ as an ordinary character; they are also very obscure when used as the body of a function (declare function f {{1:2}}). Before making this decision, we looked at how many other popular languages solve this problem.

* the decision to allow any sequence to act as a member of an array enabled things like the fn:apply() function, whose second argument is an array of arbitrary sequences; it also enabled JSON null to be represented by an empty sequence, which avoided the need for pervasive changes to the language to define how every function and operator should handle a JSON null. Reducing the number of concepts by one is a definite plus.

Getting agreement on all these points was a very lengthy process with much heated argument. Although the decisions made were not always the ones I personally advocated, I think the final language works well. If there’s one aspect I’m still a little unhappy about, it’s the fact that an array behaves like a single item, so for example

let $A := [1,2,3]
return $A[1]

returns [1,2,3]

But that’s there because we tried very hard to find a way to avoid this surprise, and failed: the sequence=item model in XDM is just too deeply embedded.

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.