<?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>30232</bug_id>
          
          <creation_ts>2018-03-20 19:14:31 +0000</creation_ts>
          <short_desc>[XSLT30] What does &lt;xsl:catch errors=&quot;foo&quot;&gt; catch? What is the NameTest localname bound to?</short_desc>
          <delta_ts>2018-03-21 13:03:22 +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>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>129096</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2018-03-20 19:14:31 +0000</bug_when>
    <thetext>I found myself wondering about this after realizing we were binding &quot;foo&quot; from the title to the Standard Error Namespace, which seems wrong.

When I went over the spec, we mention this under xsl:catch:

* That it is a list of tokens, each token a NameTest
* That error names are QNames

This suggests that &quot;pref:*&quot; must have &quot;pref&quot; statically bound to a namespace (we didn&apos;t). It also suggests that &quot;foo&quot; must be treated like other NameTests, for instance like match=&quot;foo&quot;. 

Section 9.7 defines what constructs the default element/type namespace can be used in (i.e., xpath-default-namespace). This section *does not* include, nor exclude xsl:catch/@errors.

Assuming that no inclusion means exclusion, I think it should be either

* no namespace
* the static default namespace of the containing element 

However, either of those leads to a problem: 

* If it matches no namespace, this is not explicitly declared and can be considered an ambiguous read of the spec
* if it matches the default namespace of the containing element, how to you match an error code in no namespace, without sometimes needing XML 1.1 redefinition of the default namespace?

I would like to suggest to treat this similar to the @match attribute for templates, that is that it listens to the xpath-default-namespace setting. 

This seems reasonable, as in a way it is a (limited) pattern and brings this in line with similar constructs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129097</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2018-03-20 20:34:34 +0000</bug_when>
    <thetext>The names in the catch/@errors attribute are NameTests, and we define NameTest by reference to the XPath 3.0 specification, which states:

An unprefixed QName, when used as a name test on an axis whose principal node kind is element, has the namespace URI of the default element/type namespace in the expression context; otherwise, it has no namespace URI.

Clearly the &quot;otherwise&quot; case applies here.

Furthermore, XSLT §5.1.1 ends with &quot;In all other cases, a lexical QName with no prefix represents an expanded QName in no namespace (that is, an xs:QName value in which both the prefix and the namespace URI are absent).&quot; and none  of the other cases applies.

Moreover, if any default were going to be useful it would be the error namespace, and if we had intended that we would certainly have said so.

All these points apply equally to the error-code attribute of xsl:message and xsl:assert, which should certainly follow the same rules.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129098</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2018-03-21 13:03:22 +0000</bug_when>
    <thetext>(In reply to Michael Kay from comment #1)
&gt; An unprefixed QName, when used as a name test on an axis whose principal
&gt; node kind is element, has the namespace URI of the default element/type
&gt; namespace in the expression context; otherwise, it has no namespace URI.
&gt; 
&gt; Clearly the &quot;otherwise&quot; case applies here.
Clearly, I missed that when reading through, and I thought I was thorough ;). I agree to your other points, it makes sense, thanks.

I&apos;ll close this as &quot;INVALID&quot;, as this isn&apos;t a bug and the spec is clear.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>