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: Sat, 5 Jul 2003 13:44:12 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106073DCFC2@daemsg02.software-ag.de>
To: Howard Katz <howardk@fatdog.com>, "Kay, Michael" <Michael.Kay@softwareag.com>, www-ql@w3.org
The implementor can of course enforce this rule at the syntax level if they
prefer.
 
Mike

-----Original Message-----
From: Howard Katz [mailto:howardk@fatdog.com] 
Sent: 04 July 2003 17:11
To: Kay, Michael; www-ql@w3.org
Subject: RE: what is the meaning of literals in step expressions?


Thanks for the clarification. The other viewpoint (not that I'm espousing
it, just pointing it out as a point of information) is that the more rules
the grammar enforces, the less the type system (and the poor implementer :-)
has to do.
Ta,
Howard

-----Original Message-----
From: www-ql-request@w3.org [mailto:www-ql-request@w3.org]On Behalf Of Kay,
Michael
Sent: Friday, July 04, 2003 7:47 AM
To: Howard Katz; www-ql@w3.org
Subject: 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 Saturday, 5 July 2003 07:44:18 UTC

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