title: SAXParseException creating an Enum in XSD
body: <p>I'm having trouble constructing my first XSD file. I'm trying to generate Java POJO's bases on my XSD with <code>jaxb2-maven-plugin</code>.</p>
  
  <p>To start, I've followed the example that I've seen <a href="http://www.java2s.com/Tutorial/XML/0060__XML-Schema/EnumeratingASimpleType.htm" rel="nofollow noreferrer">this tutorial</a></p>
  
  <p>This is my <code>xsd</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;xs:schema version="1.0"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
     &lt;xs:element name = "Tshirt"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name = "Color" type = "clothesColorType" /&gt;
                  &lt;xs:element name = "Size" type = "clothesSizeType" /&gt;
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  
      &lt;xs:simpleType name="clothesSizeType"&gt;
          &lt;xs:restriction base="xs:string"&gt;
              &lt;xs:enumeration value="S" /&gt;
              &lt;xs:enumeration value="M" /&gt;
              &lt;xs:enumeration value="L" /&gt;
              &lt;xs:enumeration value="XL" /&gt;
          &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
  
      &lt;xs:simpleType name="clothesColorType"&gt;
          &lt;xs:restriction base="xs:string"&gt;
              &lt;xs:enumeration value="Black" /&gt;
              &lt;xs:enumeration value="White" /&gt;
              &lt;xs:enumeration value="Green" /&gt;
              &lt;xs:enumeration value="Blue" /&gt;
          &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>When my plugin try to parse the file, I get the error </p>
  
  <pre><code>org.xml.sax.SAXParseException; systemId: file:/ruta/src/main/resources/wsdl-definition/Assurance.xsd; lineNumber: 47; columnNumber: 72; src-resolve: No se puede resolver el nombre 'clothesColorType' para un componente 'type definition'.
  </code></pre>
  
  <p>I have been googling for hours but I have not found the response. Any Ideas?</p>
  
  <p>Thank you in advance.</p>