The mysteries of software development and networking... RSS 2.0



 Friday, August 01, 2008

If you're using the xsd.exe tool to generate C# code from an XML Schema you'll find that an attribute defined as an integer is generated into a string field.

The reason is listed on MSDN:

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.

Friday, August 01, 2008 6:52:45 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
C#
About
This blog is run by Mark Blomsma.
© Copyright 2008
Develop-One
Sign In
Statistics
Total Posts: 323
This Year: 67
This Month: 0
This Week: 0
Comments: 89
All Content © 2008, Develop-One
DasBlog theme 'Business' created by Christoph De Baene (delarou)