RE: what is the meaning of literals in step expressions?

> 
> I just realized that the existing grammar allows expressions 
> such as "1/3", "//book/2", and "/bib//46.5/editor". Do 
> patterns such as these (with literals in step expressions) 
> have any valid semantic interpretation? What should an XQuery 
> implementation do on encountering such an expression? Thanks, Howard
>

The operands of "/" must be nodes, and literals are never nodes, so such
expressions will always give a type error. We have generally chosen not to
make the grammar enforce rules that are better enforced by the type system.
Writing 1/3 is just like writing "a"+"b", which is also a type error rather
than a syntax error.

Michael Kay 

Received on Friday, 4 July 2003 10:47:29 UTC