<?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>4868</bug_id>
          
          <creation_ts>2007-07-19 07:03:26 +0000</creation_ts>
          <short_desc>[XPath] abbreviations for / and // syntactically incorrect</short_desc>
          <delta_ts>2007-11-16 11:58:04 +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 2.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryan Gustafson">ryan.gustafson</reporter>
          <assigned_to name="Don Chamberlin">chamberl</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>15870</commentid>
    <comment_count>0</comment_count>
    <who name="Ryan Gustafson">ryan.gustafson</who>
    <bug_when>2007-07-19 07:03:26 +0000</bug_when>
    <thetext>In the version found at http://www.w3.org/TR/xpath20/#id-path-expressions

The statements which indicate to sometimes abbreviate / as fn:root(self::node()) treat as document-node()/ and // as fn:root(self::node()) treat as document-node()/descendant-or-self::node() are not syntactically correct.

My own parser, as well as the parser at http://www.w3.org/2006/11/applets/xpathApplet.html refuse to parse such input.

The Formal Semantics http://www.w3.org/TR/xquery-semantics/#id-path-expressions indicate a parenthesized version of the same construct.

Are the Formal Semantics are correct and XPath needs to be corrected?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15875</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-07-19 08:49:59 +0000</bug_when>
    <thetext>Personal response: Yes, I think you&apos;re right.

fn:root(self::node()) treat as document-node()/X

does not parse because the expression on the lhs of &quot;/&quot; must be a StepExpr, and a TreatExpr is not a StepExpr. It needs to be parenthesized.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15978</commentid>
    <comment_count>2</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2007-07-31 17:40:35 +0000</bug_when>
    <thetext>On July 31, 2007, the Query and XSLT working groups agreed to add parentheses to the expansions of leading-/ and leading-// in path expressions, as suggested by this bug report. The revised expansions will appear in a future errata document.
Regards,
Don Chamberlin (for the joint working groups)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17778</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-11-16 11:58:04 +0000</bug_when>
    <thetext>The agreed change will be published in Erratum XP.E3 for XPath, XQ.E3 for XQuery.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>