<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>30405</bug_id>
          
          <creation_ts>2019-03-06 12:28:48 +0000</creation_ts>
          <short_desc>[xslt30] Mode with visibility=&quot;private&quot; can still be an eligible initial mode</short_desc>
          <delta_ts>2019-03-06 16:00:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>abel.online</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>129598</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2019-03-06 12:28:48 +0000</bug_when>
    <thetext>See test case package-001i

Intuitively, the mode is declared with 

&lt;xsl:mode name=&quot;start&quot; visibility=&quot;private&quot;/&gt;

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

&lt;xsl:mode name=&quot;s&quot; streamable=&quot;yes&quot;/&gt;

and then uses &quot;s&quot; as the initial mode. However, the spec under xsl:mode is fairly clear that (a) visibility=&quot;private&quot; is the default, and (b) a mode with private visibility cannot be used as the initial mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129602</commentid>
    <comment_count>1</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2019-03-06 16:00:22 +0000</bug_when>
    <thetext>I&apos;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=&quot;private&quot; 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).

&gt; I fear this change will cause a lot of tests to fail, where there is a mode 
&gt; 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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>