<?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>28525</bug_id>
          
          <creation_ts>2015-04-21 11:35:47 +0000</creation_ts>
          <short_desc>[XSLT30] (editorial) Allowed/disallowed attributes of xsl:param</short_desc>
          <delta_ts>2015-05-01 11:20:15 +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>Windows NT</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>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abel Braaksma">abel.braaksma</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <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>119721</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-04-21 11:35:47 +0000</bug_when>
    <thetext>The opening of 9.2 Parameters does not list it as allowed for xsl:package or xsl:transform.

We seem to have two conflicting statements with regards to the tunnel attribute. In 9.2 Parameters, we say:

A)  As a child of xsl:stylesheet, to define a parameter to the transformation. 
    In this case all attributes except tunnel are permitted. Stylesheet 
    parameters are set by the calling application: see 2.3.2 Priming a 
    Stylesheet.

And at the bottom of that same chapter (just before 9.2.1):

B)  The optional tunnel attribute may be used to indicate that a parameter is 
    a tunnel parameter. The default is no; the value yes may be specified only 
    for template parameters. Tunnel parameters are described in 10.1.3 Tunnel 
    Parameters

And in 9.10 we say (2nd last para):

C)  The optional tunnel attribute may be used to indicate that a parameter is
    a tunnel parameter. The default is no. Tunnel parameters are described in 
    10.1.3 Tunnel Parameters. They are used only when passing parameters to 
    templates: for an xsl:with-param element that is a child of xsl:evaluate 
    or xsl:next-iteration the tunnel attribute must either be omitted or take 
    the value no.

So, in (A) we say it is _not permitted_, in (B) we say it is permitted but takes a value of no outside xsl:template, in (C) we say for xsl:with-param that it may take a value of no only for xsl:evaluate and xsl:next-iteration.

I propose to align these statements and keep it simple, similar to the select attribute in xsl:function, just disallow it except inside xsl:template.

Since xsl:param has so many different guises, this is what we came up with:


xsl:param in           tunnel       static       select       required
---------------------- ------------ ------------ ------------ -------------
xsl:stylesheet etc     disallowed   allowed      allowed      allowed
xsl:package            disallowed   allowed      allowed      allowed
xsl:template           allowed      disallowed   allowed      allowed
xsl:function           disallowed   disallowed   disallowed   disallowed
xsl:iterate            disallowed   disallowed   mandatory    disallowed


xsl:with-param in
---------------------- ------------
xsl:apply-templates    allowed
xsl:call-template      allowed
xsl:next-iteration     disallowed*
xsl:evaluate           disallowed*

* currently allowed only with the value no, I propose to disallow it similar 
  to the rules of xsl:param, to avoid confusion

Error summary:
XTSE0010 If a name is missing, or under xsl:iterate, if select is missing
XTSE0020 If any of the values are wrong
XTSE0090 If an attribute that is disallowed in the table above is used</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120004</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-04-30 08:19:10 +0000</bug_when>
    <thetext>The inconsistency between &quot;required&quot; and &quot;tunnel&quot; exists already in the XSLT 2.0 specification. 

For xsl:param/@tunnel (end of 9.2) 2.0 says:

The optional tunnel attribute may be used to indicate that a parameter is a tunnel parameter. The default is no; the value yes may be specified only for template parameters.

For xsl:param/@required (earlier in the same section) 2.0 says:

The optional required attribute may be used to indicate that a parameter is mandatory. This attribute may be specified for stylesheet parameters and for template parameters; it must not be specified for function parameters, which are always mandatory.

I&apos;m disinclined to introduce a backwards incompatibility here just in the interests of tidying this up. I&apos;m more inclined to go the other way, by allowing the values tunnel=&quot;no&quot;, required=&quot;yes&quot;, or static=&quot;no&quot; in all cases where the attribute is currently disallowed.

Having a table to present the options seems an excellent idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120014</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-04-30 14:33:55 +0000</bug_when>
    <thetext>You seem to be suggesting something like the following:

xsl:param in           tunnel       static       select       required
---------------------- ------------ ------------ ------------ -------------
xsl:stylesheet etc     no           yes|no       allowed      yes|no
xsl:package            no           yes|no       allowed      yes|no
xsl:template           yes|no       no           allowed      yes|no
xsl:function           no           no           *** 1)       yes
xsl:iterate            no           no           *** 2)       yes

To bring all in line and make it orthogonal, what should we do with the select-attribute? For xsl:function it is currently disallowed, for xsl:iterate it is mandatory.

For xsl:iterate it may be reasonable to have a default value of &quot;.&quot;. For xsl:function we could simply ignore it if present (and a processor can issue a warning). It could also be used on xsl:function to specify default values for overloads with missing arguments, but I believe that ship has already sailed ;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120028</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-05-01 10:41:17 +0000</bug_when>
    <thetext>The proposal in comment #1 was accepted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120029</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-05-01 11:20:15 +0000</bug_when>
    <thetext>The changes have been applied.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>