This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
5.14 Variable Declaration SCP / rule 2 XQuery 4.14 says "If a variable declaration includes both a type and an expression, the value returned by the expression must match the declared type...". Thus, this rule should have something like statEnv |- Expr : Type2 Type2 <: Type This will presumably involve splitting the rule into two, since the conclusion's "(:= Expr | external)" doesn't always provide a binding for Expr.
Yes! I thought I remember it was the way it was done. That's a good catch. We should have the following two rules: statEnv |- VarRef of var expands to Variable statEnv |- Type = [SequenceType]sequencetype statEnv1 = statEnv + varType( Variable => Type) --------------------------------------------------------------------------- statEnv |- declare variable VarRef as SequenceType external =>stat statEnv2 statEnv |- VarRef of var expands to Variable statEnv |- Type = [SequenceType]sequencetype statEnv |- Expr : Type2 statEnv |- Type2 <: Type statEnv1 = statEnv + varType( Variable => Type) -------------------------------------------------------------------------- statEnv |- declare variable VarRef as SequenceType := Expr =>stat statEnv2 - Jerome
The XSLT and XML Query Working Groups have accepted your comment and the proposed resolution. Best, - Jerome