I have a xsd file with the following xml structure. No matter what i do the MyVals enumerator is not getting generated.
<xs:simpleType name="MyVals">
<xs:restriction base="xs:string">
<xs:enumeration value="1" />
<xs:enumeration value="2" />
<xs:enumeration value="3" />
<xs:enumeration value="4"/>
</xs:restriction>
</xs:simpleType>
All other structures are correctly populating. Complete xsd is given below.
<?xml version="1.0"?>
<xs:schema targetNamespace="http://www.simple.com/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="1.0"
xmlns:wepa="http://www.simple.com/xsd"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>
<xs:element name="MessageProtocol" >
<xs:complexType >
<xs:sequence>
<xs:element name ="Header" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name ="Body" type="xs:string" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="MyVals">
<xs:restriction base="xs:string">
<xs:enumeration value="1" />
<xs:enumeration value="2" />
<xs:enumeration value="3" />
<xs:enumeration value="4"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
XSD generation command:C:\Progra~1\”Microsoft SDKs”\Windows\v6.0A\bin\xsd.exe -c /enabledDataBinding -l:c# /namespace:Simple.SimpleXSD Simple.xsd
Your MyVals type is not used within your MessageProtocol element
For starters, try declaring the Body element as follows: