<?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>23343</bug_id>
          
          <creation_ts>2013-09-24 15:13:05 +0000</creation_ts>
          <short_desc>XTDE0045 does not take xsl:mode into account</short_desc>
          <delta_ts>2014-05-15 14:00:38 +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="Abel Braaksma">abel.online</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>93730</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2013-09-24 15:13:05 +0000</bug_when>
    <thetext>Currently, the error XTDE0045 is defined as follows:

[ERR XTDE0045] It is a dynamic error if the invocation of the stylesheet specifies an initial mode (other than the default mode) that does not match the expanded QName in the mode attribute of any template defined in the stylesheet.

However, with xsl:mode and initial=&quot;yes&quot; (which is the default if not defined), the mode is in effect even when not specifically used on any template. An example of such use is the test mode-1405.xsl, which looks like:

&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;3.0&quot;&gt;
  &lt;xsl:template match=&quot;/&quot;&gt;&lt;out&gt;&lt;xsl:apply-templates/&gt;&lt;/out&gt;&lt;/xsl:template&gt;
  &lt;xsl:mode name=&quot;s&quot; on-no-match=&quot;text-only-copy&quot;/&gt;
&lt;/xsl:stylesheet&gt;

The result of this stylesheet should not be an error, because the mode is defined and, when set as initial mode, it comes into effect.

I think the error conditions should be updated to reflect this situation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93744</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-09-24 19:28:15 +0000</bug_when>
    <thetext>I have fixed this omission; the error now occurs if the mode is specified in neither a mode declaration, or a template rule.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>