#535 dateTime constructor fails with user-defined types

v8.7.1
closed
Michael Kay
5
2012-10-08
2006-06-09
Michael Kay
No

The function dateTime$date, $time) fails with a
ClassCast Exception if either of the arguments belong
to a user-defined type derived by restriction from
xs:date or xs:time respectively.

Source fix: in
net.sf.saxon.functions.DateTimeConstructor, method
evaluateItem at line 20, change the first two lines of
the method to:

DateValue arg0 =
(DateValue)((AtomicValue)argument[0].evaluateItem(context)).getPrimitiveValue();
TimeValue arg1 =
(TimeValue)((AtomicValue)argument[1].evaluateItem(context)).getPrimitiveValue();

Discussion