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 30069 - [FO31] Error codes for option parameters
Summary: [FO31] Error codes for option parameters
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 editorial
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: 2017-02-21 16:43 UTC by Michael Kay
Modified: 2017-03-15 18:34 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2017-02-21 16:43:46 UTC
Rule 6 for the option parameter conventions (ยง1.5) states:

For each named option, the function specification defines a required type for the option value. The value that is actually supplied in the map is converted to this required type using the function conversion rules. A type error [err:XPTY0004] occurs if conversion of the supplied value to the required type is not possible, or if this conversion delivers a coerced function whose invocation fails with a type error. A dynamic error occurs if the supplied value after conversion is not one of the permitted values for the option in question: the error codes for this error are defined in the specification of each function.

Now suppose the supplied value is map{"indent", xs:untypedAtomic('2')} (XSLT 3.0 test case xml-to-json-C104).

The second sentence of the rule above ("The value that is actually supplied in the map is converted to this required type using the function conversion rules") implies an error FORG0001.

But the third sentence ("A type error [err:XPTY0004] occurs if conversion of the supplied value to the required type is not possible") implies an error XPTY0004.

I think that the third sentence was intended as a gloss on the second, and the second sentence is normative. Suggested rewording:

For each named option, the function specification defines a required type for the option value. The value that is actually supplied in the map is converted to this required type using the function conversion rules. This may result in an error (typically [err:XPTY0004] or [err:FORG0001]) if conversion of the supplied value to the required type is not possible. A type error [err:XPTY0004] also occurs if the conversion delivers a coerced function whose invocation fails with a type error. A dynamic error occurs if the supplied value after conversion is not one of the permitted values for the option in question: the error codes for this error are defined in the specification of each function.
Comment 1 Michael Kay 2017-03-07 16:21:35 UTC
Liam noted "This may result" -> "This will result".
Comment 2 Andrew Coleman 2017-03-07 16:37:49 UTC
The WG agreed that this is editorial
Comment 3 Michael Kay 2017-03-15 18:34:06 UTC
The changes have been applied.