It seems that the XSD tool supplied with VS2005 does not handle
"xs:union". Am I doing something wrong? Is there a work-around?
Here is a simple sample file:
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="ELDataSet">
<xs:complexType>
<xs:sequence>
<xs:element name="TestElement" type="SpecialType"
minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="SpecialType">
<xs:union memberTypes="SimpleInts Unknowns" />
</xs:simpleType>
<xs:simpleType name="SimpleInts">
<xs:restriction base="xs:integer">
<xs:enumeration value="1" />
<xs:enumeration value="2" />
<xs:enumeration value="3" />
<xs:enumeration value="4" />
<xs:enumeration value="5" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Unknowns">
<xs:restriction base="xs:integer">
<xs:enumeration value="0" />
<xs:enumeration value="-1" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
--------------------------------------------------
Running the XSD utility on this generates code that simply defines
"TestElement" as a string (as opposed to an integer), and has none of
the enumeration values at all.
Thoughts?
Thanks!
Brad.