This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
XQuery 3.0 states that: "The expression E castable as T returns true if the result of evaluating E can be successfully cast into the target type T by using a cast expression; otherwise it returns false. If evaluation of E fails with a dynamic error, the castable expression returns false. The castable expression can be used as a predicate to avoid errors at evaluation time. It can also be used to select an appropriate type for processing of a given value, as illustrated in the following example:" Neither of the tests K2-SeqExprCastable-3 and -4 expect false, yet in each case the argument to castable raises an error. <test-case name="K2-SeqExprCastable-3"> <description> Combine operator div with castable as. </description> <created by="Frans Englich" on="2007-11-26"/> <test>(1 div 0) castable as xs:string</test> <result> <any-of> <assert-true/><!-- permitted by errors-and-optimization --> <error code="FOAR0001"/> </any-of> </result> </test-case> <test-case name="K2-SeqExprCastable-4"> <description> Combine operator div with castable as(#2). </description> <created by="Frans Englich" on="2007-11-26"/> <test>concat("2007-01-3", 1 div 0) castable as xs:date</test> <result> <error code="FOAR0001"/> </result> </test-case>
I'm closing as a result of Bug 21664.