[Bug 25158] New: [xslt 3.0] Error for uninitialized parameter of xsl:iterate

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

            Bug ID: 25158
           Summary: [xslt 3.0] Error for uninitialized parameter of
                    xsl:iterate
           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

Consider

<xsl:iterate select="...">
  <xsl:param name="p" as="xs:integer"/>

The initial value of $p is an empty sequence, which is not a valid value given
the type as="xs:integer". The error should be a static error.

The nearest we have to this in the spec is:

[ERR XTDE0610] If an optional parameter has no select attribute and has an
empty sequence constructor, and if there is an as attribute, then the default
value of the parameter is an empty sequence. If the empty sequence is not a
valid instance of the required type defined in the as attribute, then the
parameter is treated as a required parameter, which means that it is a dynamic
error if the caller supplies no value for the parameter.

but that is a dynamic error.

The "which means..." clause also seems incorrect for a parameter to a named
template; if such a parameter is required, it's a static error.

Propose changing it to:

A parameter defined using xsl:param is *implicitly required* if all the
following apply:

* it has no select attribute
* it has an empty sequence constructor
* it does not specify required="yes"
* it has an .as. attribute defining the required type, and the empty sequence
is not a valid instance of the required type

When an xsl:param element defines an implicitly required parameter, then:

* if its parent is an xsl:template with a .name. attribute, then it is a static
error [REF:XXXXXXX] if there is an xsl:call-template instruction that does not
supply a value for the parameter

* if its parent is an xsl:iterate instruction, it is a static error [XXXXXXXX]

* if its parent is an xsl:template element with a .match. attribute, it is a
dynamic error if the caller supplies no value for the parameter.

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

Received on Wednesday, 26 March 2014 14:57:40 UTC