I used xsd.exe in a remote xsd file to generate some C # class definitions. One type is defined as
<xs:element name="amount"> <xs:simpleType> <xs:restriction base="xs:decimal"> <xs:fractionDigits value="2"/> </xs:restriction> </xs:simpleType> </xs:element>
When I try to deserialize an xml file, I get an error:
There is an error in XML document (30, 12). ---> System.FormatException: Input string was not in a correct format.
This only happens when the comma is used as a grouping delimiter (i.e. 87,000). If I go through and remove commas wherever error deserialization works,
Is there any modification that I can do to make xsd allow grouping of a comma? Or is it even better to allow this in my code? Trying to parse the decimal code in my code with commas works fine, it just doesn't like it in the XML file.
source share