W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2005

[Bug 1225] New: description of / and // (editorial)

From: <bugzilla@wiggum.w3.org>
Date: Thu, 07 Apr 2005 10:27:21 +0000
To: public-qt-comments@w3.org
Message-Id: <E1DJUEL-0002Tx-Rx@wiggum.w3.org>


           Summary: description of / and //  (editorial)
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: davidc@nag.co.uk
         QAContact: public-qt-comments@w3.org


describes / as

A "/" 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
"/" is the entire path expression).

and // as

A "//" 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


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


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'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 "." is part of
the sentence structure not part of the expression (there is a font change but
that's not easy to see on a ".") just inserting a space would probably be enough.

Received on Thursday, 7 April 2005 10:27:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:23 UTC