Why does xsd.exe generate string property for xs:integer?

This behavior is by design:

The xs:integer type is specified as a number with no upper or lower
bound on its size. For this reason, neither XML serialization nor
validation map it to the System.Int32 type. Instead, XML serialization
maps the xs:integer to a string while validation maps it to the
Decimal type that is much larger than any of the integer types in the
.NET Framework

Use xs:int, which is a signed 32-bit integer, to have Xsd.exe map it to a System.Int32:

<xs:element name="InvoiceNo" type="xs:int" />

Here’s a detailed list of the data types defined in the XML Schema Definition standard.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)