This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Section 2.3 says that an optional initial mode must be supplied, but it does not specify what is the possible sets of values that this take. This is relevant when the initial template candidates include one with a mode of #all. Does #all match all theoretically valid modes (i.e. the local name is a valid NCName, and the namespace URI, if present, is a lexically valid URI), or does it match only those nodes that are present in the (compiled) stylesheet? I had assumed the latter, but a test case assumes the former. I have read over the spec again, to see if my assumption can be dis-proven, but I cannot see that. Nor can I see it the other way, so I think the spec. is ambiguous.
When I raised the bug, I was only concerned that the ambiuity was resolved one way or the other. But now having thought about it a bit more, it is clear to me that it should be resolved in the direction of only allowing modes that are specifically defined in the compiled stylesheet. The only reason for supplying an initial mode is to override the default mode. So it makes no sense to supply a mode that is not defined. And it is very harmful, if the selected initial template (or some descendant of it in the match/call chain) should then dispatch on the current mode. The user is entitled to a good error message if (s)he mis-types the name of the initial mode. I can think of no use cases for the opposite interpretation.
I agree. I would propose: (a) In 6.5 change the token #all, to indicate that the template rule is applicable to all modes. to the token #all, to indicate that the template rule is applicable to all modes (that is, to the default mode and to every mode that is named in an xsl:apply-templates instruction or xsl:template declaration anywhere in the stylesheet) (b) In 2.3 change Optionally, an initial mode. to Optionally, an initial mode. This must be either the default mode, or a mode that is explicitly named in the mode attribute of an xsl:template declaration within the stylesheet. (c) Add to this paragraph: If an initial mode is supplied, then an initial context node MUST be supplied, and an initial template MUST NOT be supplied. (d) Add error codes for the above conditions.
Sounds good to me.
The proposal in comment #2 was accepted at today's telcon.
Spec now updated