previous  next

Quantified Expressions

In XQuery, but not XPath, you may specify a type for the bound variable in a quantified expression.

every $a as xs:integer in (1.0, 2) satisfies $a = 0

This only affects error handling, an error is raised if there is an item that does not have the specified type.

Currently xq2xsl silently drops the type annotation. I'm considering rewriting to the following.

every $a in (for $r in ( 1.0 , 2 ) return $r treat as xs:integer)
    satisfies ($a =  0 )