RE: Abbreviated Syntax "//"

That depends entirely on how the chosen implementation parses the
grammar and handles expansion. Since "//" and "x" are two distinct
location steps I do not see the source of the confusion.

Implementers need not be so literal as to actually replace "//" with
"/descendant-or-self::node()" when processing the statement.  It is
sufficient to understand that "/" represents a separator between steps,
and that "//" represents a separator plus a "descendand-or-self::node()"
step.

emerson

-----Original Message-----
From: xquery@comcast.net [mailto:xquery@comcast.net] 
Sent: Tuesday, 16 September 2003 4:10 AM
To: emerson@harvestman.net
Subject: Re: Abbreviated Syntax "//"


Becuase //x would be /descendant-or-self::node()x which is a syntax
error.
You need the trailing slash to specify the step following.

This isn't new to XQuery, it's been this way since XPath 1.0 five years
ago.
> 
> 
> Ive just noticed something that hasn't bothered me in the past due
> mainly to an omission on my part.  In implementing some Xpath 2.0
> features into my now hybrid 1.0 processor I noticed that according to
> both specifications;
> 
> http://www.w3.org/TR/xpath20/#abbrev
> 
> The abreviated, location path in 1.0 speak, or path expression in 2.0
> language  i.e. "//"
> Is actually interpreted as "/descendant-or-self::node()/" rather than
> "/descendant-or-self::node()"
> 
> I beg to ask, why the trailing slash "/" ?  
> 
> This forces the abreviated syntax to have a following step, when there
> is a perfectly valid reason for wanting to use "//" alone.
> 
> I don't like to deviate, but this is one part of the grammar that I
> don't think I will be enforcing...
> 
> emerson
> 
> 
> 

Received on Tuesday, 16 September 2003 07:40:26 UTC