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 29242 - Overriding a required parameter with an optional parameter
Summary: Overriding a required parameter with an optional parameter
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Last Call 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: 2015-10-26 09:37 UTC by Michael Kay
Modified: 2015-10-30 15:38 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2015-10-26 09:37:13 UTC
In 3.5.3.3, the compatibility rules for overriding of variables and parameters state:

If the overridden variable is a parameter that specifies required="yes" then the overriding variable is either a non-parameter variable, or a parameter that specifies required="yes"

This rule seems unnecessary and illogical. It essentially says that variables can override parameters, and parameters can override variables, in all cases except the following: an optional parameter cannot override a required parameter.

But an optional parameter always supplies a default, so why not? As written, if a library package has a required parameter LINE_LENGTH, then I can override this with a variable LINE_LENGTH set to 80, but I cannot override it with an optional parameter LINE_LENGTH whose default is 80.

In addition the terminology 'required="yes"' is wrong. If we make the rule for explicitly required parameters then it should also apply to implicitly required parameters.

Proposal: delete this rule.
Comment 1 Michael Kay 2015-10-26 10:45:38 UTC
In case anyone needs convincing, the current rules allow me to override a required parameter with a variable, and then to override the variable with an optional parameter, so I can do it in two steps but can't do it in one.
Comment 2 Michael Kay 2015-10-30 12:39:43 UTC
The WG accepted this change. (Though time was short and one member expressed an intent to study the problem further and push back if problems were found).

The change has been applied to the spec.