W3C home > Mailing lists > Public > www-ql@w3.org > July to September 2003

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

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Fri, 4 Jul 2003 16:47:23 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106073DCFBB@daemsg02.software-ag.de>
To: Howard Katz <howardk@fatdog.com>, www-ql@w3.org
> 
> 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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:16 UTC