RE: Variable Declaration in Query Prolog

Variables in XQuery are mainly named subexpressions (due to the
functional characteristic). To achieve type checking use ASSERT, CAST or
TREAT.

Best regards
Michael

> -----Original Message-----
> From: TAN Kuan Hui [mailto:kuanhui@mobileworkspace.com]
> Sent: Wednesday, January 23, 2002 17:43 PM
> To: www-ql@w3.org
> Subject: Variable Declaration in Query Prolog
> 
> Hi,
> 
> Could anyone shed some light as to why variable declaration shouldn't
> be declared in the query prolog ? Wouldn't variable declaration be
> desirable for static-typing to be more effective ?
> Vis-a-vis, variables can be made to default to type Item if
> it was not declared and thereafter down-cast accordingly ?
> 
> Ref : 2.1.1.1 Static Context (XQuery 1.0)
> Quote : "Unlike the other parts of the static context, variable types
are
> not declared in the query prolog. Instead, they are derived from
static
> analysis of the expressions in which the variables are bound"
> 
> Thanks.
> Kuan Hui
> 
> 
> 
> 
> 
> 

Received on Sunday, 3 February 2002 11:29:04 UTC