<?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>1225</bug_id>
          
          <creation_ts>2005-04-07 10:27:21 +0000</creation_ts>
          <short_desc>description of / and //  (editorial)</short_desc>
          <delta_ts>2005-05-05 08:36:10 +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>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 2000</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="David Carlisle">davidc</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>3823</commentid>
    <comment_count>0</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-04-07 10:27:21 +0000</bug_when>
    <thetext>http://www.w3.org/TR/xquery/#id-path-expressions

describes / as

A &quot;/&quot; at the beginning of a path expression is an abbreviation for the initial
step fn:root(self::node()) treat as document-node() (this is true even if the
&quot;/&quot; is the entire path expression).

and // as

A &quot;//&quot; at the beginning of a path expression is an abbreviation for the initial
steps fn:root(self::node()) treat as document-node()/descendant-or-self::node()/. 


Note that the expansion of // ends with a trailing / and the expansion of / does
not. It would be more correct (I think) if it did end with a trailing slash
unless the / was the entire expression.

Alternatively (and perhaps better) neither expansion should end with a trailing
slash but the text should stress that the expansion is a complete step and in
particular a predicate is not allowed to follow.

For example

fn:root(self::node())[*]

is legal and selects root nodes that have a top level element.
but

fn:root(self::node())/[*]

is a syntax error.

I believe the intention (and the xquery grammar) is that

/[*]

is an error rather than selecting a root node that has an element child.

One more minor point that I wouldn&apos;t have commented on except that I noticed it
while pasting in the description of // above, the expanded example ends the
sentence and it would help if some indication that the following &quot;.&quot; is part of
the sentence structure not part of the expression (there is a font change but
that&apos;s not easy to see on a &quot;.&quot;) just inserting a space would probably be enough.


David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3824</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2005-04-07 16:25:29 +0000</bug_when>
    <thetext>I don&apos;t think that we should change this. Note that rewriting / to (fn:root
(self::node()) treat as document-node())/ would yield a syntactically 
incorrect expression. 

And I also think that /[expr] should be allowed as expression. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3825</commentid>
    <comment_count>2</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-04-07 16:36:58 +0000</bug_when>
    <thetext>My (first) suggestion was to amend the expansion of a leading / so that it
explitly had 2 different expansions, without a trailing / in the case that there
is no following step. Currently the text highlights the fact that the expansions
are the same, but then if a trailing / is not needed in the expansion of / this
reader at least is left asking why one is needed in the expansion of //.

The alternative is to not put a trailing / on either and just use the statement
that it is a complete step to disallow a following predicate.  This is how Xpath
1 dissallowed the syntax .[expr] . (in Xpath1) abreviates a complete step.

So far I think all the discussion is editorial: how best to describe the current 
behaviour

  And I also think that /[expr] should be allowed as expression. 

That of course would be a substantive change. I wouldn&apos;t disagree with it. As I
note above, XPath2 has already made a similar change allowing .[expr] which was
previously disallowed.

allowing /[expr] but not allowing //[expr] would of course be a convincing
argument to explain why the expansion of / does not end with a / but the
expansion of // does.

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3527</commentid>
    <comment_count>3</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2005-05-04 23:16:01 +0000</bug_when>
    <thetext>David,
Thanks for your comment. The Query working group has discussed your comment and 
we agree with you that the expansion of initial &quot;/&quot; should include a 
trailing &quot;/&quot; unless the initial &quot;/&quot; is the entire path expression. I have 
edited the XPath/XQuery specification accordingly. We view this as an editorial 
correction and not as a substantive change to the language. I have also acted 
on your editorial suggestion to move the sentence-closing period away from the 
expansion of &quot;//&quot;.

Since we have implemented your suggestions, I will assume that this issue is 
satisfactorily resolved unless you reply to the contrary.

Best regards,
--Don Chamberlin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3537</commentid>
    <comment_count>4</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-05-05 08:36:10 +0000</bug_when>
    <thetext>Thanks

David</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>