title: XSD Error: Type is not declared, or is not a simple type
body: <p>For this explanation I am using 2 different XSDs:</p>
  
  <p><strong>customEntry.xsd</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema id="customEntry"
      targetNamespace="http://tempuri.org/customEntry.xsd"
      elementFormDefault="qualified"
      xmlns="http://tempuri.org/customEntry.xsd"
      xmlns:mstns="http://tempuri.org/customEntry.xsd"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"        
      &gt;
    &lt;xs:simpleType name="customEntry"&gt;
      &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:pattern value="[A-Za-z0-9_%./]*"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p><strong>element_ArtStyleSuffix.xsd</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema id="element_ArtStyleSuffix"
      targetNamespace="http://tempuri.org/element_ArtStyleSuffix.xsd"
      elementFormDefault="qualified"
      xmlns="http://tempuri.org/element_ArtStyleSuffix.xsd"
      xmlns:mstns="http://tempuri.org/element_ArtStyleSuffix.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
      &gt;
    &lt;xs:import namespace="http://tempuri.org/customEntry.xsd" schemaLocation="customEntry.xsd"/&gt;
  
    &lt;!-- Civilizations ArtStyleSuffix Enumeration --&gt;
    &lt;xs:simpleType name="enum_ArtStyleSuffix"&gt;
      &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:enumeration value="_EURO"/&gt;
        &lt;xs:enumeration value="_AFRI"/&gt;
        &lt;xs:enumeration value="_AMER"/&gt;
        &lt;xs:enumeration value="_ASIA"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
  
    &lt;!-- ArtStyleSuffix GameData Schema Information --&gt;
    &lt;xs:element name="GameData"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:all&gt;
          &lt;xs:element minOccurs="0" maxOccurs="1" name="ArtStyleSuffix"&gt;
            &lt;xs:annotation&gt;
              &lt;xs:documentation&gt;
                Select a default ArtStyleSuffix or you may create your own custom one and place its TypeName here.
              &lt;/xs:documentation&gt;
            &lt;/xs:annotation&gt;
            &lt;xs:simpleType&gt;
              &lt;xs:union memberTypes="customEntry enum_ArtStyleSuffix"/&gt;
            &lt;/xs:simpleType&gt;
          &lt;/xs:element&gt;
        &lt;/xs:all&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>My problem is with the following line:</p>
  
  <pre><code>&lt;xs:union memberTypes="customEntry enum_ArtStyleSuffix"/&gt;
  </code></pre>
  
  <p>Visual Studio 2015 community is throwing the error: </p>
  
  <blockquote>
    <p>Type '<a href="http://tempuri.org/element_ArtStyleSuffix.xsd:customEntry" rel="nofollow">http://tempuri.org/element_ArtStyleSuffix.xsd:customEntry</a>' <strong>is
    not declared, or is not a simple type</strong>.</p>
  </blockquote>
  
  <p>It looks like a simple type to me and I thought the import line declared it, so maybe I don't understand "import" fully cause I'm not receiving any errors from the import line just the union line.  Am I doing this correctly?</p>