#405 castable applied to a constant

v8.5.1
closed
nobody
5
2012-10-08
2005-09-10
Michael Kay
No

If the XPath "castable as" operator is applied to a
literal, or to a constant subexpression, it fails to
check whether the operand is a single atomic value, and
instead tests the first item in the sequence supplied
as the operand.

For example, ((1, 2) castable as xs:int) returns true,
when it should raise an error.

Source code fixed, test case qxmp295.

Discussion