the following expression:
fn:string('2006-12-28T15:42:04.190+01:00' cast as xs:dateTime)
gives the string:
2006-12-28T15:42:04.19+01:00
So I get 19 milliseconds instead of 190 milliseconds.
I made a dirty fix for me:
class DateTimeValue
public CharSequence getStringValueCS() {
FastStringBuffer sb = new FastStringBuffer(30);
....
....
if (microsecond != 0) {
sb.append('.');
int ms = microsecond;
int div = 100000;
//dirty fix!!!!! begin
// while (ms > 0) {
for (int i = 0; i < 3; i++) {
//dirty fix!!!!! end
int d = ms / div; sb.append((char)(d + '0')); ms = ms % div; div /= 10; } }
with best regards
Logged In: YES
user_id=251681
Originator: NO
Firstly, please don't post to this area. There's a big yellow notice on the bug submission page explaining why: it's easier for users to find known bugs if this area only contains confirmed bugs. Use the saxon-help list or forum if you want to report a suspected problem. (Also, if you categorize the bug wrongly, no-one gets notified: I only found this report by chance.)
This isn't a bug. 4.190 and 4.19 are the same number. 4.19 doesn't represent 4 seconds an 19 milliseconds, it represents 4.19 seconds, which is the same as 4.190 seconds. In fact, if you read section 17.1.2 of the Functions and Operators specification carefully, you will see that the processor is required to return "4.19", and returning "4.190" would be non-conformant.
Michael Kay