<?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>26788</bug_id>
          
          <creation_ts>2014-09-13 16:19:56 +0000</creation_ts>
          <short_desc>[XPath30] XQuery-only errors in XPath 3.0 specification, like XQST0134</short_desc>
          <delta_ts>2014-10-14 08:46:58 +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>XPath 3.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</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.braaksma</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>jmdyck</cc>
    
    <cc>mike</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>111467</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-09-13 16:19:56 +0000</bug_when>
    <thetext>Some errors seem to have gotten their way into the XPath 3.0 Recommendation (also the internal XPath 3.1 Draft) that are by name and intend XQuery-specific.

err:XQST0134: XQuery 3.0 does not support the namespace axis.

This error serves an XQuery-specific case. I think that both the error condition and the error code should be removed. If not, then it makes sense to rename the error code to XPST0134, in line with the naming conventions of XPath errors.

Furthermore, the way it is written currently under 3.3.5, it appears that XPath 3.0 normatively prohibits the namespace axis, as the text says &quot;if the NodeTest in an axis step is a NamespaceNodeTest then... error&quot;, but in the Note following the text, it makes this XQuery-specific. I think the following should be valid XPath:

@namespace-node()


Other cases, merely editorial, using the wrong naming conventions:

err:XQST0039: &quot;It is a static error for an inline function expression to have more than one parameter with the same name.&quot;

Should be renamed XPST0039.

err:XQST0046: &quot;An implementation MAY raise a static error if the value of a BracedURILiteral is of nonzero length and is neither an absolute URI nor a relative URI.&quot;

Should be renamed XPST0046.

err:XQST0052: &quot;The type must be the name of a type defined in the in-scope schema types, and the {variety} of the type must be simple.&quot;

Should be renamed XPST0052.

err:XQST0070: &quot;A static error is raised if one of the predefined prefixes xml or xmlns appears in a namespace declaration or a default namespace declaration[...]&quot;

Should be renamed XPST0070.

Note: in the current internal XPath 3.1 draft, err:XQDY0136, err:XQDY0137 have been introduced that ought to be errXPDY0136 and err:XPDY0137 respectively.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111590</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-09-16 14:55:02 +0000</bug_when>
    <thetext>Nice catch.

I can make sure that this does not appear in XPath 3.1:

* err:XQST0134: XQuery 3.0 does not support the namespace axis.

I don&apos;t think we can change the names of error conditions that have appeared in a Recommendation now. We should discuss how to handle 3.0 errata in a telcon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112498</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-09-30 21:29:37 +0000</bug_when>
    <thetext>(In reply to Jonathan Robie from comment #1)
&gt; Nice catch.
&gt; 
&gt; I can make sure that this does not appear in XPath 3.1:
&gt; 
&gt; * err:XQST0134: XQuery 3.0 does not support the namespace axis.
&gt; 
&gt; I don&apos;t think we can change the names of error conditions that have appeared
&gt; in a Recommendation now. We should discuss how to handle 3.0 errata in a
&gt; telcon.

In making this change, I realized that this occurs in the context of the abbreviated syntax, where the default axis is child.  

The text occurs here:

http://www.w3.org/TR/xpath-30/#abbrev

Namespace nodes can be found only on the namespace axis, never on the child axis or the attribute axis, so what is the correct behavior for XPath in this case, in a host language that supports the namespace axis?

Saxon XSLT treats this as a warning, saying that the child axis will never return any namespace nodes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112499</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-09-30 21:50:53 +0000</bug_when>
    <thetext>Here is what I did for the XPath 3.1 draft:

&lt;quote&gt;
If the axis name is omitted from an axis step, the default axis is child, with two exceptions: if the NodeTest in an axis step contains an AttributeTest or SchemaAttributeTest then the default axis is attribute; in an implementation that does not support the namespace axis, an error is raised [err:XQST0134].

Note:

In an implementation that does not support the namespace axis, an attempt to access it always raises an error. Thus, an XQuery implementation will always raise an error in this case, since XQuery does not support the namespace axis. The namespace axis is deprecated as of XPath 2.0, but required in some languages that use XPath, including XSLT.
&lt;/quote&gt;

&lt;quote&gt;
err:XQST0134

    The namespace axis is not supported.
&lt;/quote&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112504</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2014-09-30 22:52:08 +0000</bug_when>
    <thetext>(In reply to Jonathan Robie from comment #3)
&gt; 
&gt; &lt;quote&gt;
&gt; If the axis name is omitted from an axis step, the default axis is child,
&gt; with two exceptions: if [...] then the default axis is attribute; in an
&gt; implementation that does not support the namespace axis, an error is raised
&gt; [err:XQST0134].
&gt; &lt;/quote&gt;

No, if the second exception omits the syntactic constraint on the NodeTest, you&apos;re saying that, with an implementation that doesn&apos;t support &apos;namespace&apos;, you can only omit the axis name when it&apos;s &apos;attribute&apos;.

I think the text should be something like:

&lt;quote&gt;
If the axis name is omitted from an axis step, the default axis is &apos;child&apos;,
with two exceptions: if [...] then the default axis is &apos;attribute&apos;;
if the NodeTest in an axis step is a NamespaceNodeTest then
   &lt;xquery&gt;
   a static error is raised [err:XQST0134],
   because XQuery does not support the namespace axis.
   &lt;/xquery&gt;

   &lt;xpath&gt;
   in an implementation that supports the namespace axis, the default axis is
   &apos;namespace&apos;; in an implementation that does not support the namespace axis,
   a static error is raised [err:XQST0134].
   &lt;/xpath&gt;
&lt;/quote&gt;

(This might be more comprehensible if the two exceptions were formatted as bullet points. You could also start the bullets after &quot;axis step&quot;, and add a third bullet: &quot;Otherwise, the default axis is &apos;child&apos;&quot;.)

(In any case, I think you could omit the Note that follows.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112509</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-01 00:31:54 +0000</bug_when>
    <thetext>(In reply to Michael Dyck from comment #4)

&gt; I think the text should be something like:
&gt; 
&gt; &lt;quote&gt;
&gt; If the axis name is omitted from an axis step, the default axis is &apos;child&apos;,
&gt; with two exceptions: if [...] then the default axis is &apos;attribute&apos;;
&gt; if the NodeTest in an axis step is a NamespaceNodeTest then
&gt;    &lt;xquery&gt;
&gt;    a static error is raised [err:XQST0134],
&gt;    because XQuery does not support the namespace axis.
&gt;    &lt;/xquery&gt;
&gt; 
&gt;    &lt;xpath&gt;
&gt;    in an implementation that supports the namespace axis, the default axis is
&gt;    &apos;namespace&apos;; in an implementation that does not support the namespace
&gt; axis,
&gt;    a static error is raised [err:XQST0134].
&gt;    &lt;/xpath&gt;
&gt; &lt;/quote&gt;


I do not think that is the intended meaning of the text - neither XPath 1.0 nor XPath 2.0 ever default to the namespace axis in abbreviated syntax.

But my text was also wrong, misuse of conditional markup ... here&apos;s a second try:

&lt;quote text=&quot;XPath 3.1&quot;&gt;
If the axis name is omitted from an axis step, the default axis is child, with two exceptions: if the NodeTest in an axis step contains an AttributeTest or SchemaAttributeTest then the default axis is attribute; if the NodeTest in an axis step is a NamespaceNodeTest in an implementation that does not support the namespace axis, an error is raised [err:XQST0134].

Note:

The namespace axis is deprecated as of XPath 2.0, but required in some languages that use XPath, including XSLT.
&lt;/quote&gt;

&lt;quote text=&quot;XQuery 3.1&quot;&gt;
If the axis name is omitted from an axis step, the default axis is child, with two exceptions: if the NodeTest in an axis step contains an AttributeTest or SchemaAttributeTest then the default axis is attribute; if the NodeTest in an axis step is a NamespaceNodeTest then a static error is raised [err:XQST0134].

Note:

The namespace axis is deprecated as of XPath 2.0, but required in some languages that use XPath, including XSLT.
&lt;/quote&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112513</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2014-10-01 02:26:51 +0000</bug_when>
    <thetext>(In reply to Jonathan Robie from comment #5)
&gt; 
&gt; I do not think that is the intended meaning of the text - neither XPath 1.0
&gt; nor XPath 2.0 ever default to the namespace axis in abbreviated syntax.

Of course not: they don&apos;t have a syntactic context in which one would even contemplate defaulting to the namespace axis. That is, they don&apos;t have  NamespaceNodeTest. That was introduced in XPath/XQuery 3.0 (or technically, XPath 2.1 / XQuery 1.1). And back then, the decision was that with a NamespaceNodeTest, the axis does indeed default to the namespace axis (which thus causes an error in impls of XPath that don&apos;t support the namespace axis, and in all impls of XQuery). See Bug 9298, comment #2.

I&apos;m pretty sure that decision wasn&apos;t subsequently overturned.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112515</commentid>
    <comment_count>7</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-01 02:52:57 +0000</bug_when>
    <thetext>(In reply to Michael Dyck from comment #6)

&gt; And back then, the decision was that with a
&gt; NamespaceNodeTest, the axis does indeed default to the namespace axis (which
&gt; thus causes an error in impls of XPath that don&apos;t support the namespace
&gt; axis, and in all impls of XQuery). See Bug 9298, comment #2.
&gt; 
&gt; I&apos;m pretty sure that decision wasn&apos;t subsequently overturned.

Hmmm, interesting.

I tried this with Saxon EE 9.5.1.2:

    &lt;xsl:template match=&quot;/top/namespace-node()&quot;&gt;
        &lt;a&gt;Hi, mom!&lt;/a&gt;
    &lt;/xsl:template&gt;

and got the following error:

&quot;The child axis will never select any namespace nodes.&quot;

But 9298#2 is quite clear.  Does anyone else believe it was ever overturned?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112545</commentid>
    <comment_count>8</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-02 00:47:00 +0000</bug_when>
    <thetext>Here&apos;s the final text for the LCWD:

&lt;xquery&gt;
If the axis name is omitted from an axis step, the default axis is child, with two exceptions: (1) if the NodeTest in an axis step contains an AttributeTest or SchemaAttributeTest then the default axis is attribute; (2) if the NodeTest in an axis step is a NamespaceNodeTest then a static error is raised [err:XQST0134].

Note:

The namespace axis is deprecated as of XPath 2.0, but required in some languages that use XPath, including XSLT.
&lt;/xquery&gt;

&lt;errors&gt;
err:XQST0134

    The namespace axis is not supported.
&lt;/errors&gt;

&lt;xpath&gt;
If the axis name is omitted from an axis step, the default axis is child, with two exceptions: (1) if the NodeTest in an axis step contains an AttributeTest or SchemaAttributeTest then the default axis is attribute; (2) if the NodeTest in an axis step is a NamespaceNodeTest then the default axis is namespace - in an implementation that does not support the namespace axis, an error is raised [err:XQST0134].

Note:

The namespace axis is deprecated as of XPath 2.0, but required in some languages that use XPath, including XSLT.
&lt;/xpath&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112547</commentid>
    <comment_count>9</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-02 01:05:23 +0000</bug_when>
    <thetext>Fixed in 3.1, but not in 3.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112549</commentid>
    <comment_count>10</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-10-02 02:09:49 +0000</bug_when>
    <thetext>Are you sure it is fixed in 3.1 (the part on the error codes, I mean)? Because the LCWD of XPath 3.1 currently present at https://www.w3.org/XML/Group/qtspecs/specifications/xquery-31/html/xpath-31.html (member only) still mentions the XQuery-only error-codes: 

err:XQST0039, should be err:XPST0039
err:XQST0046, should be err:XPST0046
err:XQST0052, should be err:XPST0052
err:XQST0070, should be err:XPST0070
err:XQST0134, should be err:XPST0134
err:XQDY0137, should be err:XPST0137

or am I speaking too soon and was the change not published yet?

Or, in response to:

&gt; I don&apos;t think we can change the names of error conditions that have 
&gt; appeared in a Recommendation now. We should discuss how to handle 3.0
&gt; errata in a telcon.

Did you mean by that that you cannot change them in subsequent versions of the spec either? Because I was under the impression that error codes were changed between versions (think of the XSLT errors for XSLT 2.0 functions that moved to XPath 3.0 and the errors were renumbered). And if you have:

a) mention them in an errata for 3.0
b) change them in subsequent versions

then wouldn&apos;t that suffice?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112552</commentid>
    <comment_count>11</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2014-10-02 03:42:40 +0000</bug_when>
    <thetext>(In reply to Jonathan Robie from comment #8)
&gt; Here&apos;s the final text for the LCWD:
&gt; 
&gt; &lt;xquery&gt;
&gt; [...]
&gt; 
&gt; Note:
&gt; 
&gt; The namespace axis is deprecated as of XPath 2.0, but required in some
&gt; languages that use XPath, including XSLT.
&gt; &lt;/xquery&gt;

For the *XQuery* spec, a note here that only talks about XPath seems somewhat beside the point.

Other than that, I think the text looks okay.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112569</commentid>
    <comment_count>12</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-02 11:45:47 +0000</bug_when>
    <thetext>(In reply to Abel Braaksma from comment #10)
&gt; Are you sure it is fixed in 3.1 (the part on the error codes, I mean)?
&gt; Because the LCWD of XPath 3.1 currently present at
&gt; https://www.w3.org/XML/Group/qtspecs/specifications/xquery-31/html/xpath-31.
&gt; html (member only) still mentions the XQuery-only error-codes: 
&gt; 
&gt; err:XQST0039, should be err:XPST0039
&gt; err:XQST0046, should be err:XPST0046
&gt; err:XQST0052, should be err:XPST0052
&gt; err:XQST0070, should be err:XPST0070
&gt; err:XQST0134, should be err:XPST0134
&gt; err:XQDY0137, should be err:XPST0137

We have a 3.0 Recommendation that uses those error codes, so we can&apos;t really change them now.  Imagine a world in which moving from 3.0 to 3.1 changes the error codes that you get for the same error conditions ... especially if you have written code that depends on those codes.

I did mention this in the Working Group telcon, and the Working Group affirmed that we should not change these codes now.  One person made the very valid observation that we would have been better off with codes that do not identify the specification, since error conditions are shared across specifications and what is used by a given specification can change over time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112588</commentid>
    <comment_count>13</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-10-02 14:37:29 +0000</bug_when>
    <thetext>One reason we felt able to change codes when moving things like format-date from XSLT 2.0 to XPath 3.0 is that XSLT 2.0 had made error codes very &quot;low key&quot;, emphasizing that (a) conformant processors were not expected to generate the error codes, and (b) there was no interface in the spec that allowed applications access to them. 

These error codes are used to label error conditions in this specification... They are provided primarily for ease of reference. Implementations may use these codes when signaling errors, but they are not required to do so.

That changes with 3.0 and try/catch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112589</commentid>
    <comment_count>14</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-02 14:39:36 +0000</bug_when>
    <thetext>I believe I have followed the WG&apos;s instructions on how to resolve this.  I will close it again, feel free to reopen if you believe further discussion is needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113070</commentid>
    <comment_count>15</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-10-14 08:46:58 +0000</bug_when>
    <thetext>See also bug #12599</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>