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

Re: Empty sequences in "for" clause bindings

From: Philippe Michiels <philippe.michiels@ua.ac.be>
Date: Thu, 8 Jul 2004 19:36:54 +0200
To: Stéphane Mbaye <stephane.mbaye@gael.fr>
Cc: "XQuery" <www-ql@w3.org>
Message-Id: <200407081936.55351.philippe.michiels@ua.ac.be>

According to the Formal Semantics (section FOR expressions)
<quote>
The evaluation of a for expression distinguishes two cases: If the iteration 
expression Expr1 evaluates to the empty sequence, then the entire expression 
evaluates to the empty sequence:
dynEnv |- Expr1 => ()
dynEnv |- for VarRef1 TypeDeclaration? in Expr1 return Expr2 => ()
</quote>

Since the expression you mentioned is normalized into two separate for loops, 
you will get the empty sequence as a result.

Best,
Ph

On Thursday 08 July 2004 18:58, Stéphane Mbaye wrote:
> Dear all,
>
> how “for” clause tuples are generated when some of the bounded variables
> match the empty sequence ?
>
> For example should the following query return (1, 2, 3), an error or
> anything else ?
>
> for $a in (), $b in (1, 2, 3)
> return ($a, $b)
>
>
> Regards
>
>
> Stéphane
> Mbaye
>   _____
>
>
> GAEL Consultant
> Cité Descartes
> 18, rue Albert Einstein
> 77420 Champs-sur-Marne
> France
> Software Director
>
> mailto:stephane.mbaye@gael.fr
> http://www.gael.fr
>
>
> tel +33-(0)1 64 73 99 55
> fax +33-(0)1 64 73 51 60

-- 
Philippe Michiels
Universiteit Antwerpen
ADReM (Advanced Database Research and Modelling)
http://www.adrem.ua.ac.be/~michiels
Received on Thursday, 8 July 2004 13:37:22 UTC

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