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 30405 - [xslt30] Mode with visibility="private" can still be an eligible initial mode
Summary: [xslt30] Mode with visibility="private" can still be an eligible initial mode
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Recommendation
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: 2019-03-06 12:28 UTC by Michael Kay
Modified: 2019-03-06 16:00 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2019-03-06 12:28:48 UTC
See test case package-001i

Intuitively, the mode is declared with 

<xsl:mode name="start" visibility="private"/>

so one would expect (as the author of the test expects) that the mode is not eligible as an initial mode.

However, the mode satisfies rule 5 of the rules for eligibility (§2.3.3):

A (named or unnamed) mode M is eligible as an initial mode if one of the following conditions applies, where P is the top-level package of the stylesheet:...

(5)The effective value of the declared-modes attribute of the explicit or implicit xsl:package element of P is no, and M appears as a mode-name in the mode attribute of a template rule declared within P.

However, §6.6.1 reflects the intuitive expectation:

A named mode is not eligible to be used as the initial mode if its visibility is private.

So I think rule (5) in §2.3.3 should be amended to read:

(5) There is no explicit xsl:mode declaration for mode M, and M appears as a mode-name in the mode attribute of a template rule declared within P.

(Note that if there is no explicit xsl:mode declaration, then it can be inferred that the effective value of the declared-modes attribute of the explicit or implicit xsl:package element of P is no)

I fear this change will cause a lot of tests to fail, where there is a mode declaration with no visibility attribute.  Test streamable-001, for example, has

<xsl:mode name="s" streamable="yes"/>

and then uses "s" as the initial mode. However, the spec under xsl:mode is fairly clear that (a) visibility="private" is the default, and (b) a mode with private visibility cannot be used as the initial mode.
Comment 1 Abel Braaksma 2019-03-06 16:00:22 UTC
I'm not sure I fully understand your point here. The title of this bug report suggests that you argue that an xsl:mode with visibility="private" is an eligible initial mode.

But from your comments it seems to me you draw a different conclusion, that any named, explicitly private mode cannot be the initial mode (unless it appears in the outermost default-mode attribute).

> I fear this change will cause a lot of tests to fail, where there is a mode 
> declaration with no visibility attribute.  Test streamable-001, for example,...

True. When I noticed that we often expect the test driver to use a private mode as initial mode, I tried to catch all cases (and clearly missed a few) where this happened and made the initial mode and/or the initial named template public.  

I originally logged this under bug#30398, and for discussion (as I am not convinced this is necessarily expected behavior), under spec bug#30401.