This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23594 - [xslt 3.0] new JSON specification
Summary: [xslt 3.0] new JSON specification
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-22 12:56 UTC by Michael Kay
Modified: 2014-05-15 14:00 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael Kay 2013-10-22 12:56:23 UTC
We should reference the new JSON specification ECMA-404

http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf

This isn't just a matter of changing the bibliography, because we allow parse-json to specify which spec it's dealing with. I don't know of any significant differences in this version.
Comment 1 Michael Kay 2013-11-28 23:07:22 UTC
Because the two specifications are (as far as I can determine) identical, I have simply replaced all references to ECMA-262 with references to ECMA-404, mutatis mutandis.
Comment 2 Michael Kay 2014-03-06 22:29:38 UTC
There is now yet another JSON specification at

http://rfc7159.net/rfc7159
Comment 3 Michael Kay 2014-03-07 08:36:33 UTC
See also Tim Bray's blog at

https://www.tbray.org/ongoing/When/201x/2014/03/05/RFC7159-JSON

explaining the rationale for the new RFC.

Since the JSON spec is moving in the direction that other internet specs have followed of containing lots of fuzzy interoperability advice and guidance rather than hard and fast rules, I'm inclined to abandon our attempts to legislate exactly what products should do, and just point them to best practice. It's not our task to write yet another version of the JSON spec.
Comment 4 Innovimax 2014-03-07 09:11:06 UTC
I think you can also add http://json5.org/ to this list
Comment 5 Michael Kay 2014-03-07 09:20:30 UTC
Does JSON5 have any official backing or community momentum, or is it just one geek who has appropriated the name for his own private project?
Comment 6 Michael Kay 2014-04-24 18:43:17 UTC
The XSL WG agreed today that we will reference rfc7159 normatively; we may also include a non-normative reference to Tim Bray's blog posting. We need to get XQuery WG to agree this is the way forward.

We should remove the "spec" option from the relevant functions that allows the user a choice of which specification to use.
Comment 7 Michael Kay 2014-04-25 11:02:51 UTC
The change has been applied.
Comment 8 Abel Braaksma 2014-05-07 11:25:59 UTC
I understand that we now don't support RFC4627 or ECMA-404 anymore, except as an extension to liberal := yes.

Reopening, because there are still a few references left over that refer to the "spec" option, or refer to the old specifications or old syntax. 

Summarizing:

Validate option:
"or against an implementation-defined schema if the spec option has the value liberal."

should become:
"or against an implementation-defined schema if the liberal option has the value yes.

Error [ERR XTDE3240] 
"It is a dynamic error if the value of $input does not conform to the JSON grammar, as selected using the explicit or implicit spec option."

should become:
"It is a dynamic error if the value of $input does not conform to the JSON grammar, as specified by [RFC7159], and when liberal is set to yes."

Error [ERR XTDE3260] 
'It is a dynamic error if the value of $options includes an entry whose key is "spec" and whose value is not a single xs:string, or an entry whose key is "validate" or "unescape" and whose value is not a single xs:boolean.'

should become:
'It is a dynamic error if the value of $options includes an entry whose key is "liberal", "validate" or "unescape" and whose value is not a single xs:boolean, or an entry "fallback" whose value is not a function item that conforms to function(xs:string) as xs:string.'

Errors under E. Summary of Error conditions have the same texts, currently.

Notes:
The paragraph "ECMA-404 differs from RFC 4627 in two respects: [...] array." can be removed.

The paragraph "Many JSON implementations allow commas [...] Representation of JSON." should be revised or removed.

Examples:
Example "The expression json-to-xml('"abcd"', map{'spec': 'RFC4627'}) [...] not a string.)." should be removed or revised.

Example "The expression json-to-xml('"abcd"', map{'spec': 'ECMA-404'})[...] abcd</string>." should be removed or revised.

Example: the last example, right under "The following example illustrates ..." contains the "spec" option, this should be revised.

Normative references
The text of the link contains "4627", while the link was updated to refer to 7159: "IETF. The JavaScript Object Notation (JSON) Data Interchange Format. July 2006. See http://www.ietf.org/rfc/rfc4627.txt"
Comment 9 Michael Kay 2014-05-13 13:37:54 UTC
The corrections noted in comment #8 have been applied.