title: My XSD type is being ignored by MS' XSD.exe tool
body: <p>My XSD has this in it, for a field which contains a date but may be empty:</p>
  
  <pre><code>  &lt;xs:simpleType name="DateOrEmpty"&gt;
      &lt;xs:union&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base='xs:string'&gt;
            &lt;xs:length value="0"/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base='xs:dateTime' /&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:union&gt;
    &lt;/xs:simpleType&gt;
  
  &lt;xs:element name="person"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="NAME" type="xs:string" /&gt;
        &lt;xs:element name="BIRTHDAY" type="xs:dateTime" /&gt;
        &lt;xs:element name="ANNIVERSARY" type="DateOrEmpty" /&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>I run this through "XSD.exe myFile.xsd /classes" and get a resulting class like the following:</p>
  
  <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.33440")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  public partial class person {
  
      private string nAMEField;
      private System.DateTime bIRTHDAYField;
      private string aNNIVERSARYField; //huh?
  </code></pre>
  
  <p>So what happened to my <code>DateOrEmpty</code> type? it's nowhere to be seen!</p>