RE: Abbreviated Syntax "//"

If "//" expanded to "/descendant-or-self::node()" then "//para" would expand
to "/descendant-or-self::node()para", which would be a syntax error.

The language could of course be defined so that "//" was a valid expression,
meaning perhaps //* or //node() or even /|//node(), but since all these
possible interpretations can already be easily written, there seems little
benefit in abbreviating them further, especially as none of these
expressions seem to be frequently required in practice.

Also, if "//" was a valid expression, then it could be followed by the "/"
operator, exacerbating further the problems in parsing pathological
expressions such as "///".

Michael Kay 

> -----Original Message-----
> From: Emerson [mailto:emerson@harvestman.net] 
> Sent: 16 September 2003 03:11
> To: public-qt-comments@w3.org
> Subject: Abbreviated Syntax "//"
> 
> 
> 
> 
> 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 11:21:45 UTC