[Bug 29699] New: [XSLT30] XTSE3085 needs slight clarification for <xsl: template name="x" /> situation

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

            Bug ID: 29699
           Summary: [XSLT30] XTSE3085 needs slight clarification for
                    <xsl:template name="x" /> situation
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: minor
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: abel.braaksma@xs4all.nl
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

(probably editorial)

This arose from a report against Exselt which was first considered an Exselt
error but I think its behavior is correct.

The way the error is currently described suggests that it is illegal to have an
xsl:template declaration with no mode-attribute unless you declare the unnamed
mode with an xsl:mode declaration. I don't think that is correct.

The error currently (note the last sentence):

<quote>
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-or-self having an [xsl:]default-mode attribute.
</quote>

Consider:

<xsl:package ...>
  <xsl:template name="foo">bla</xsl:template>
</xsl:package>

According to the definition above, this should raise an error (xsl:template has
has no mode attribute).

I propose the last sentence to be editorially update with something like:

<proposal>
A package implicitly uses the unnamed mode if there is an xsl:template with a
match attribute but no mode attribute, or an xsl:apply-templates element with
no mode attribute, and with no ancestor-or-self having an [xsl:]default-mode
attribute.
</proposal>

This would make the above example legal. Only if rewritten like the following,
would (correctly) throw XTSE3085 (it implicitly uses the undeclared default
mode):

<xsl:package ...>
  <xsl:template name="foo" match="/">bla</xsl:template>
</xsl:package>

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

Received on Sunday, 19 June 2016 17:18:43 UTC