Support #5152
closed'Input string was not in a correct format' while compiling stylesheet
0%
Description
Hi,
We have a xslt file that was produced from some schematron files that contain business rules for tax validations (provided by a third party tax authority).
We have been using Saxon 9 to validate the XML file, but because we are targetting .NET Core in our products we need to migrate this code to Saxon 11 CS.
In saxon 11 CS the xsltCompiler.Compile(new StringReader("the stylesheet")) is throwing "System.FormatException: 'Input string was not in a correct format.'"
at Singulink.Numerics.BigDecimal.Parse(ReadOnlySpan`1 s, NumberStyles style, IFormatProvider formatProvider)
Because the stylesheet worked on Saxon 9 HE i would like to know if this is a bug / limitation of the current version and if there is a fix on the foreseable future or an immediate workaround for the problem.
Thanks.
Orlando Ribeiro¶
Files
Updated by Martin Honnen about 3 years ago
Test whether setting Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture
helps.
Updated by Michael Kay about 3 years ago
I think this is a duplicate of bug #5134.
We've got a fix ready to go in the first maintenance release but haven't yet upgraded the test suite to make sure we test for non-English locale settings in future.
Updated by Orlando Ribeiro about 3 years ago
Hi,
Yes, it is, indeed working as expected after you suggestion.
Is there a less "global" way to do this? I fear that changing this setting around may cause issues in multi-threaded environments for the app...
Thanks!
Updated by Michael Kay about 3 years ago
I think that's the recommended workaround until we get the patch out. (You could also of course change the locale/culture settings for the machine, but that really is "global".)
Updated by Orlando Ribeiro about 3 years ago
Thank you! Will apply the workaround and wait for the patch.
Sorry for the duplicate ;)
Orlando
Please register to edit this issue