<?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>29122</bug_id>
          
          <creation_ts>2015-09-12 17:47:28 +0000</creation_ts>
          <short_desc>[XSLT30] declared-modes and [xsl:]default-mode</short_desc>
          <delta_ts>2015-10-29 12:42:28 +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>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</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.braaksma</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>123176</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-09-12 17:47:28 +0000</bug_when>
    <thetext>We say in relation to declared-modes:

The declared-modes attribute of xsl:package determines whether or not modes that are referenced within the package must be explicitly declared. If the value is yes (the default), then it is an error to use a mode name in xsl:template or xsl:apply-templates, or in the [xsl:]default-mode attribute of any element, or to use the unnamed mode explicitly or implicitly in these contexts, unless the package either contains an explicit xsl:mode declaration for that mode, or accepts the mode from a used package. If the value is no, then this is not an error.

In message https://lists.w3.org/Archives/Member/w3c-xsl-wg/2015Sep/0015.html (member-only) it is pointed out that this could be read as indicating that since the default for [xsl:]default-mode is #unnamed, a stylesheet that does not use the [xsl:]default-mode attribute must declare the unnamed mode.

Furthermore the error condition for XTSE3085, unlike the prose description, does not make it an error to reference an undeclared mode in @default-mode unless the default value is actually used.

I think these ambiguities can be avoided by

(a) shortening the prose description to:

The declared-modes attribute of xsl:package determines whether or not modes that are referenced within the package must be explicitly declared. If the value is yes (the default), then it is an error to use a mode name unless the package either contains an explicit xsl:mode declaration for that mode, or accepts the mode from a used package. If the value is no, then this is not an error.

(b) tightening the error description to:

[ERR XTSE3085] It is a static error, when the effective value of the declared-modes attribute of an xsl:package element is yes, if the package contains an explicit reference to an undeclared mode, or if it implicitly uses the unnamed mode and the unnamed mode is undeclared. A mode is declared if the package contains an xsl:mode declaration for that mode, or if the mode is a public or final mode accepted from a used package. The offending reference may occur in the mode attribute of an xsl:template or xsl:apply-templates instruction, or in an [xsl:]default-mode attribute. The offending reference may be either an explicit mode name, or the token #unnamed treated as a reference to the unnamed mode. A package implicitly uses the unnamed mode if there is an xsl:template or xsl:apply-templates element with no mode attribute, and with no ancestor having an [xsl:]default-mode attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123177</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-09-12 19:25:34 +0000</bug_when>
    <thetext>I have applied these changes to the spec, while leaving the bug open for WG review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123418</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-01 17:11:36 +0000</bug_when>
    <thetext>The change was accepted. But in the diff version of the document there is a problem with one of the links to the changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123419</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-01 17:52:46 +0000</bug_when>
    <thetext>Re the markup problem: I think the anchor was on a p element child of an error element which the stylesheet doesn&apos;t copy into the HTML. Fixed this, but won&apos;t know it&apos;s really fixed until the spec is rebuilt. Closing now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>