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 28058 - fn:parse-json: Handling unknown keys
Summary: fn:parse-json: Handling unknown keys
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: 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: 28059
  Show dependency treegraph
 
Reported: 2015-02-19 12:51 UTC by Christian Gruen
Modified: 2016-12-16 19:55 UTC (History)
0 users

See Also:


Attachments

Description Christian Gruen 2015-02-19 12:51:32 UTC
The current F&O spec states in 17.5.1 that "Implementations must ignore any entries in the map whose keys are not defined in this specification, unless the key has a specific ·implementation-defined· meaning.".

I would like to see an error raised instead, as I believe it would be more user-friendly to reject unknown keys. We are already raising errors for unknown values, so maybe we can use the same error code?
Comment 1 Michael Kay 2015-02-19 14:11:11 UTC
There is a trade-off here, but we decided that it was a good idea to allow new options to be introduced by vendors or in future releases without causing queries to fail if they use such options, and are then run with a product that does not recognize them. This is the way extension attributes in XSLT work, for example, and it has worked very well. We could have used namespaces so that extensions are self=contained, but that seemed over-engineered for the purpose.
Comment 2 Christian Gruen 2015-02-19 14:18:37 UTC
> We could have used namespaces so that extensions are self=contained,
> but that seemed over-engineered for the purpose.

This approach was chosen for XQuery annotations – annotations in the default namespace are rejected – but I see that such a decision would introduce incompatibilities with XSLT.