<?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>7410</bug_id>
          
          <creation_ts>2009-08-24 11:26:21 +0000</creation_ts>
          <short_desc>[XSLT 2.1] Declare context item for a named template</short_desc>
          <delta_ts>2011-06-08 20:40:02 +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>Working 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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>sca.w3c</cc>
          
          <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>26616</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-08-24 11:26:21 +0000</bug_when>
    <thetext>We have introduced a declaration xsl:context-item to declare the type and other properties of the context item at the level of the initial stylesheet invocation. It would be useful to reuse this construct to allow declaration of the context item supplied to a named template. At present the scope for static checking of named templates against a schema is very limited, because the type of the context item is not known and cannot be declared.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36944</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-16 11:09:25 +0000</bug_when>
    <thetext>Accepted in principle at the Oxford F2F. Need some syntax to say whether the context item is required, optional, or prohibited. Using &quot;?&quot; after the item type doesn&apos;t quite capture the fact that if there&apos;s no context item, &quot;.&quot; is an error rather than an empty sequence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42613</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-11-18 16:42:56 +0000</bug_when>
    <thetext>I propose that xsl:template should have a permitted child element xsl:context-item, to appear optionally before any xsl:param elements, with the syntax

&lt;xsl:context-item
  use = required|optional|prohibited
  as? = ItemType /&gt;

If the template is unnamed, then use=required is the only permitted value.

If use=prohibited is specified then the as attribute must be absent.

The element declares requirements on the context item, whether the template is invoked by match or by name. The use attribute declares whether the context item is required or optional; the value prohibited indicates that the context item is set to absent on entry to the template (it does not mean that it&apos;s an error if there is a context item at the time of the call).

If there is a context item supplied by the caller, then it must match the given item type; otherwise a type error occurs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46951</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-03-24 13:45:07 +0000</bug_when>
    <thetext>Current status: this feature is in the status quo draft.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49339</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-06-08 20:39:46 +0000</bug_when>
    <thetext>Closing this on the grounds that we now have a design in the current draft that meets the requirements.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>