[Monetdb-developers] An XQuery question

Jens Teubner jens.teubner at in.tum.de
Mon May 7 09:35:37 CEST 2007


On Sun, May 06, 2007 at 10:28:57PM +0200, Ying Zhang wrote:

> If I run the follwoing XQuery query with Galax:
> 
> ==========
> test.xq
> ==========
> declare namespace t = "test";
> 
> declare function t:echoVoid() { () };
> t:echoVoid()
> ==========
> 
> Galax gives a warning:
> 
> $ galax-run ~/test.xq 
> [WARNING] 
> Expression '???' at File "/ufs/zhang/test.xq", line 3, characters 8-37
> has empty type, but is not the empty expression

Jennie,

it is a static type error when expressions can statically be determined
to return the empty sequence.  The XQuery Formal Semantics allows such
empty sequences only in very rare cases (e.g., as the argument of a
function call).  This is why Galax complains.  Pathfinder's type
checker, unfortunately, is not smart enough to detect these kind of
things and does not complain.

The rationale behind the behavior as specified in the specs is that an
XQuery processor could detect typos in the user input query, e.g., if a
user mis-types tag names in XPath location steps.  A fully schema-aware
system might be able to detect such things.

Jens

-- 
Jens Teubner
Technische Universitaet Muenchen, Department of Informatics
D-85748 Garching, Germany
Tel: +49 89 289-17259     Fax: +49 89 289-17263

Things are pretty mixed up, but I think the worst is over.
                         -- TeX Error Message




More information about the developers-list mailing list