ValidationException: Cannot convert string .. to a double
The Saxon XSLT and XQuery processor, developed by Saxonica
Brought to you by:
mhkay
Basically we are greeting ValidationException: Cannot convert string "2,243.234" to a double
Looking at the code for Value.stringToNumber() I don't see that it accepts , as a thousand separator (Digit grouping).
Do you think this is a bug or feature?
We used saxonb9-0-0-8
I got this error in cruisecontrol while running transformation or very long test results.
e.g. log fragment to transform is:
<testsuite failures="0" time="2,243.234" errors="0" skipped="0" tests="1" name="com.,,,,.client.LoginStressTest">
<testcase time="2,243.234" classname="com....client.LoginStressTest" name="testLoginRoot"/>
</testsuite>
First, please note that I ask people to submit support requests on the saxon-help mailing list or forum, not in this tracker. That is so that users can find genuine confirmed bugs more easily.
This is not a bug. The rules for string-to-double conversion are strictly laid down in the XSLT/XQuery/XPath specifications, and they do not allow commas as thousands separators. I would suggest using the translate() function to remove the commas before applying the conversion.