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 29478 - [XSLT30] Allow selecting all component types inside xsl:accept/xsl:expose
Summary: [XSLT30] Allow selecting all component types inside xsl:accept/xsl:expose
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Candidate Recommendation
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:
 
Reported: 2016-02-17 11:13 UTC by Abel Braaksma
Modified: 2016-10-06 18:42 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2016-02-17 11:13:02 UTC
You cannot currently simply say "accept all components but one" or "hide all components but one", you have to write five statements to achieve that. This is less then ideal.

During the F2F this issue was raised and there was some sympathy towards this suggestion. Essentially, the @components should accept a "*" or a list of component tokens.
Comment 1 Michael Kay 2016-02-17 14:09:00 UTC
Suggestion:

(a) Add the syntax component="*". If this is used, the names attribute must contain only wildcards.

(b) The semantics of <accept component="*" ...> or <expose component="*"...> is equivalent to having five declarations

<accept component="function" ...>
<accept component="template" ...>
etc with the same attributes (other than @component).

Other suggestions: 

(i) use "all" or "#all" in place of "*"
(ii) allow a space-separated list of component-kind names
(iii) change the default: if there is at least one <xsl:accept>, then only the components that are explicitly accepted are accepted; if there is no <xsl:accept>, then everything is accepted. (Ditto for <xsl:expose>).

We recorded consensus on this general direction, with direction to the editor to prepare a detailed proposal. The choice of keywords will be deferred until we see the detailed proposal.
Comment 2 Michael Kay 2016-02-23 23:11:49 UTC
Proposal:

For xsl:expose and xsl:accept:

(a) Allow the value component="*", meaning all kinds of component.

(b) If component="*" is specified, then every token in the *names* attribute must be a Wildcard (static error if not).

(c) The effect of specifying component="*" is equivalent to replicating the declaration five times with the same values for the names and visibility attributes, and each of the five permitted values for the component attribute.

I decided not to propose changes along the lines "if there is an xsl:accept, then the default changes to "don't accept anything unless specified". I tried drafting such rules and they get complex; the change is substantive and there's a high risk of getting it wrong. I think the changes above are enough: you just have to add 

<xsl:accept component="*" names="*"/>

to flip the default.

For xsl:expose the changes get even more intricate because of the interaction with explicit visibility attributes.

I prefer component="*" rather than component="all" or component="#all" because of the proximity of the names attribute where "*" means "all names".
Comment 3 Michael Kay 2016-04-14 16:25:11 UTC
The proposal was accepted.