[Bug 29122] New: declared-modes and [xsl:]default-mode

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29122

            Bug ID: 29122
           Summary: declared-modes and [xsl:]default-mode
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Saturday, 12 September 2015 17:47:30 UTC