RE: Path Expression question

I have an action item (ACTION-Gaith-6) to clarify this in the documents 
for the next pub, though it should be theoretically unambiguous from the 
lexical state tables.  "/" does not recognize operators (i.e. symbols 
recognized in the OPERATOR state) immediately following it.

-scott

public-qt-comments-request@w3.org wrote on 06/26/2003 11:49:47 AM:

> 
> > A question about path expressions:
> > 
> > "/" is a legal expression
> > "/ + 5" also seems to be legal
> > 
> > so,
> > 
> > "(/) * 5" is probably legal
> > "(/) div 5" likewise
> > 
> > what about
> > 
> > "/ * 5" or "/ div 5"
> > 
> > Do we require spaces? Or parentheses? Or does an xpath parser 
> > need to look ahead to distinguish these cases? (My vote is 
> > for parentheses).
> 
> My understanding is that we require parentheses, but I'm not sure this 
is
> clearly documented. The examples above are actually all legal in XPath 
1.0,
> which has a known bug in that it doesn't describe how to disambiguate 
these
> cases. Fortunately none of the above examples is likely to appear often 
in
> real code. In XPath 2.0, though, it becomes more likely: for example "if 
(/
> is $n)" needs to be written as "if ((/) is $n)", or perhaps as "if (/. 
is
> $n)". Or you can always write root(.)!
> 
> Michael Kay
> 

Received on Monday, 30 June 2003 11:46:10 UTC