I have created an XSD and have run XSD.exe on top of that .xsd file. It seems that my simple types that are restricted to enumeration values are not being generated as enums in the outputted .cs file.
For example, my xsd looks like this:
<xs:element name="ItemList" nillable="false">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="Item" type="ItemType" minOccurs="1" maxOccurs="unbounded" nillable="false">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="ItemType">
<xs:sequence maxOccurs="1" minOccurs="1">
<!-- other complex types, etc... -->
</xs:sequence>
<xs:attribute name="Market" type="MarketType" use="required">
</xs:attribute>
<xs:attribute name="Category" type="CategoryType" use="required" />
</xs:complexType>
<xs:simpleType name="CategoryType">
<xs:restriction base="xs:string">
<xs:enumeration value="Mild" />
<xs:enumeration value="Hot" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="MarketType">
<xs:restriction base="xs:string">
<xs:enumeration value="Weak" />
<xs:enumeration value="Strong" />
</xs:restriction>
</xs:simpleType>
When I run XSD.exe shouldn't the outputted .cs file have an xml enum attribute for each of my simple types? This link says that it should. Maybe I am doing something wrong? No where in my .cs file do I see an enum.
If you need any more information, let me know what I can provide.
Thanks.
UPDATE:
It seems that I was using XSD.exe to create a dataset (/d switch), when I should have been creating a class (/c switch). After I set it generate a class, it worked correctly.