#575 Decimal zero output as \"00\"

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

When the result of a calculation involving xs:decimal
numbers is zero, it is possible that when converted to
a string, the result is displayed with multiple zeros
(for example "00" or "000"). This happens on JDK 1.5
when the underlying computation produces a BigDecimal
value with integer value = 0 and a negative scale. It
does not happen on JDK 1.4, because there Saxon
normalizes the value itself; on 1.5 it relies on the
stripTrailingZeros method in the BigDecimal class,
which does not deal with this case.

An example is the XQTS test case
fn-seconds-from-dateTime-13 which does the calculation:

fn:seconds-from-dateTime(xs:dateTime("1970-01-01T10:10:10Z"))
mod
fn:seconds-from-dateTime(xs:dateTime("1970-01-01T03:10:10Z"))

The problem affects Saxon 8.8; it is also likely to
affect earlier releases though this has not been checked.

A source patch will be placed in Subversion. It affects
module DecimalValue in package net.sf.saxon.value.

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks