[Bug 28355] [XSLT30] (probably editorial) Unintended disappearance of XTDE0610 error

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

--- Comment #6 from Abel Braaksma <abel.braaksma@xs4all.nl> ---
I agree that we currently do not have a way to distinguish between
stylesheet-level (meaning: stylesheet-module-level) and package-level
parameters. In fact, a stylesheet parameter is defined as:

    [Definition: A top-level xsl:param element declares a stylesheet parameter. 
    A stylesheet parameter is a global variable with the additional property 
    that its value can be supplied by the caller when a transformation is 
    initiated.] 
    As described in 9.2 Parameters, a stylesheet parameter may be declared as 
    being mandatory, or may have a default value specified for use when no
value
    is supplied by the caller. The mechanism by which the caller supplies a 
    value for a stylesheet parameter is implementation-defined. An XSLT 
    processor must provide such a mechanism.

In another bug, it is already being rectified that "top-level" should also
apply to children of xsl:package.

There is currently no way in the specification to distinguish between
same-named package-level and stylesheet-level parameters by the invoker of the
stylesheet, but such a mechanism would be implementation defined anyway.

My suggestion in comment#4 was to change the wording "stylesheet parameter" to
"package parameter", because we now have implicit and explicit packages, and
not stylesheets per se anymore, but that was my bad, I noticed now:

    [Definition: A stylesheet consists of one or more packages: specifically, 
    one top-level package and zero or more library packages.]

    [Definition: A package consists of one or more stylesheet modules, each 
    one forming all or part of an XML document.]

Which effectively invalidates my argument to replace the term "stylesheet
parameter" with "package parameter", as here a stylesheet is defined of one or
more packages, and not the other way around.

-----------------

Looking again at the definitions of the errors here:

1a) [ERR XTDE0050] It is a dynamic error if a stylesheet declares a visible 
    stylesheet parameter with required="yes" and no value for this parameter 
    is supplied when the stylesheet is primed.[...].

1b) It is an error if no value is supplied for a mandatory stylesheet 
    parameter [see ERR XTDE0050].

2a) It is a dynamic error [see ERR XTDE0700] if the template rule selected 
    for processing any item in the initial match selection defines a template
    parameter that specifies required="yes" and no value is supplied for that
    parameter.

2b) It is a dynamic error [see ERR XTDE0700] if the initial named template, 
    or any of the template rules invoked to process items in the initial match
    selection, defines a template parameter that specifies required="yes" and 
    no value is supplied for that parameter.

2c) [ERR XTDE0700] It is a dynamic error if a template that has an explicitly
    mandatory or implicitly mandatory parameter is invoked without supplying a 
    value for that parameter.

2d) In other cases it is a dynamic error if the template that is invoked 
    declares a template parameter with required="yes" and no value for this 
    parameter is supplied by the calling instruction. [see ERR XTDE0700]

2e) If a tunnel parameter is declared in an xsl:param element with the 
    attribute tunnel="yes", then a dynamic error occurs [see ERR XTDE0700] if 
    the set of tunnel parameters passed to the template does not include a 
    parameter with a matching expanded QName.

While this looks like a plethora of definitions for XTDE0700 (2a - 2e), I
believe they indeed cover what Michael Kay is writing in comment#5: all cases
where it can be a dynamic error and an (implicitly) required template parameter
is missing, raised XTDE0700.

MKay wrote:
> and it would probably useful to say that this includes both "explicitly 
> mandatory" and "implicitly mandatory", with better cross-referencing 
> between section 9.5 and sction 9.2.2.

The descriptions between 1a and 1b seem to augment each other, but I'd agree
here, it'd be better to bring them in line.

-------------

Concluding: my 2p: the only thing that warrants some editorial fixing is the
XTDE0050 error, the XTDE0700 error(s) cover all their respective cases and the
package vs stylesheet parameter distinction is of no consequence.

As an aside: we might consider including the term "static or non-static"
explicitly in the definition of stylesheet parameters.

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

Received on Saturday, 18 April 2015 21:03:05 UTC