Project

Profile

Help

Support #5152

closed

'Input string was not in a correct format' while compiling stylesheet

Added by Orlando Ribeiro over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2021-11-03
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
11
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
.NET

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

DocExemplo.xml (5.95 KB) DocExemplo.xml Example XML Orlando Ribeiro, 2021-11-03 12:34
urn_feap.gov.pt_CIUS-PT_2.1.1_Full-compiled.xsl (713 KB) urn_feap.gov.pt_CIUS-PT_2.1.1_Full-compiled.xsl Our stylesheet Orlando Ribeiro, 2021-11-03 12:34
Program.cs (1.58 KB) Program.cs The code snippet for the validation Orlando Ribeiro, 2021-11-03 12:34
Actions #1

Updated by Martin Honnen over 2 years ago

Test whether setting Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture helps.

Actions #2

Updated by Michael Kay over 2 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.

Actions #3

Updated by Orlando Ribeiro over 2 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!

Actions #4

Updated by Michael Kay over 2 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".)

Actions #5

Updated by Orlando Ribeiro over 2 years ago

Thank you! Will apply the workaround and wait for the patch.

Sorry for the duplicate ;)

Orlando

Actions #6

Updated by Michael Kay over 2 years ago

  • Status changed from New to Closed

Please register to edit this issue

Also available in: Atom PDF