This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1378 - [XQuery] some editorial comments on A.1.1 grammar-note: leading-lone-slash
Summary: [XQuery] some editorial comments on A.1.1 grammar-note: leading-lone-slash
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Scott Boag
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard: grammar
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-11 07:31 UTC by Michael Dyck
Modified: 2007-02-25 23:51 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2005-05-11 07:31:43 UTC
A.1.1 grammar-note: leading-lone-slash

[See a later comment for suggested alternate wording.]

"stand alone unit"
    Change to "complete path expression".

'a leading prefix that expects a pattern to follow such as a QName or "*".'
    "leading prefix" is a bit vague.
    "expects" is suspect.
    change to 'the start of a path expression, followed by a terminal such as a
    QName or "*"'

"Both of these patterns also may occur as patterns which are recognized in
contexts where operators may occur."
    Not clear whether "both of these patterns" refers to "stand alone unit" and
    "leading prefix", or QName and "*". The latter, I think.

    But *QNames* don't "occur as patterns which are recognized in contexts where
    operators may occur." Instead, keywords (that could be mistaken for QNames)
    do.

'Thus, expressions such as "/ * 5" can easily be confused with the path
expression "/*".'
    By parsers.

"Therefore, a stand-alone slash on the right hand side of an operator,"
    "right"?? Surely "left"!

    It's not clear what you include in "operator". Do you include things like
    "+" and "-", where no confusion can arise? (e.g., "/+..." can't be the start
    of a path expression, so the slash must be a complete path expression.)

"will need to be parenthesized in order to stand alone,"
    It would be good to first say that it's illegal, and then get into how to
    achieve the intended effect legally.

    You don't *need* to parenthesize it -- that's just the easiest way to
    construct an equivalent legal query.
Comment 1 C. M. Sperberg-McQueen 2005-07-07 01:31:52 UTC
For what it's worth, I agree that this note should probably be
reworded.  On the other hand, I have some isuses with the 
rewording proposed in Bug 1390.

Working partly from the current text, partly from this comment,
and partly from the proposal in bug 1390, I produce this sketch,
for what it's worth:

   A single slash may appear either as a complete path expression
   or as the first part of a path expression in which it is
   followed by a RelativePathExpression, which can take the form
   of a NameTest ("*" or a QName).  In contexts where operators
   like "*", "union", etc., can occur, parsers may have
   difficulty distinguishing operators from NameTests.  For
   example, without lookahead the first part of the expression "/
   * 5", for example is easily taken to be a complete expression,
   "/ *", which has a very different interpretation (the child
   nodes of "/").

   [Optionally display the two parse trees from bug 1390 here.]

   To reduce the need for lookahead, therefore, if the token
   immediately following a slash is "*" or a keyword, then the
   slash must be the beginning, but not the entirety, of a
   PathExpression (and the following token must be a NameTest,
   not an operator).

   A single slash may be used as the left-hand argument of an
   operator by parenthesizing it: "(/) * 5".  The expression "5 *
   /", on the other hand, is legal without parentheses.

This is longer and clumsier than I'd like, and could use a
cold-eyed revision by a merciless editor.  But I offer it
as a possible improvement.
Comment 2 Scott Boag 2005-07-09 03:53:20 UTC
(In reply to comment #1, but covers the original comment as well.)
> Working partly from the current text, partly from this comment,
> and partly from the proposal in bug 1390, I produce this sketch,
> for what it's worth:

Text adapted.

>    [Optionally display the two parse trees from bug 1390 here.]

I don't want to start displaying parse trees.  The issue is clear enough without
them.

> This is longer and clumsier than I'd like, and could use a
> cold-eyed revision by a merciless editor.  But I offer it
> as a possible improvement.

It's better.  I suggest we live with whatever shortcomings there may be.
Comment 3 Scott Boag 2005-07-22 19:29:36 UTC
A joint meeting of the Query and XSLT working groups considered this comment on 
July 20, 2005.  

The WGs agreed to resolve these editorial issues as listed in my previous comment.

If you do not agree with this resolution, please add a comment explaining why.
If you wish to appeal the WG's decision to the Director, then change the Status
of the record to Reopened. If we do not hear from you in the next two weeks, we
will assume you agree with the WG decision.
Comment 4 Jim Melton 2007-02-25 23:51:59 UTC
Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.