Hi Brad,
Thanks for KJ's quickly reply.
I'm afraid there are two issue in your XSD file.
1) Actually, XSD.exe doesn't support xs:union.
http://msdn2.microsoft.com/en-us/library/bc57azyw.aspx [Union Element Binding Support ]
When Xsd.exe encounters a simple type defined by union, it will ignore the
<simpleType> definition and uses the built-in string data type in its place.
To resolve this issue, you may create a union SimpeType manually in your
xsd file.
<xs:simpleType ...>
<xs:restriction ...>
<xs:enumeration value="1" />
...
<xs:enumeration value="0" />
<xs:enumeration value="-1" />
</xs:restriction>
</xs:simpleType>
2) Only when the <enumeration> facet is applied to string-based types like
xsd:string does the Xsd.exe translate it into a .NET Framework enum
definition
http;//msdn2.microsoft.com/en-us/library/z2w0sxhf.aspx
[Enumeration Element Binding Support]
This means the "SimpleInts" in your xsd file will be translated as "string"
type rather than "int" type.
<xs:simpleType name="SimpleInts">
<xs:restriction base="xs:int">
<xs:enumeration value="1" />
...
</xs:restriction>
Otherwise, you may set base to "xs:int" and delete enumeration from your
xsd file.
<xs:simpleType name="SimpleInts">
<xs:restriction base="xs:int">
</xs:restriction>
Hope this helps. Please let me know if you have anything unclear. I'm glad
to assit you.
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx. ==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.