title: Defining a complexType in xsd: Src-resolve: Cannot Resolve The Name 'variable1' To A(n) 'type Definition' Component
body: <p>I get an error:</p>
  
  <blockquote>
    <p>Src-resolve: Cannot Resolve The Name 'variable1' To A(n) 'type Definition' Component.</p>
  </blockquote>
  
  <p>by validating the following scheme:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"&gt;
  
                 ...
  
                              &lt;xs:element name="variables" maxOccurs="1"&gt;
                              &lt;xs:complexType&gt;
                                  &lt;xs:annotation&gt;
                                      &lt;xs:documentation&gt;AWK external variables (from bash)&lt;/xs:documentation&gt;
                                  &lt;/xs:annotation&gt;
                                  &lt;xs:sequence&gt;
                                      &lt;xs:element name="variable" type="variable" minOccurs="1"/&gt;
                                      &lt;xs:complexType name="variable"&gt;
                                          &lt;xs:sequence&gt;
                                              &lt;xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/&gt;
                                              &lt;xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1"/&gt;
                                          &lt;/xs:sequence&gt;
                                      &lt;/xs:complexType&gt;
                                  &lt;/xs:sequence&gt;
                              &lt;/xs:complexType&gt;
                          &lt;/xs:element&gt;
  
  
  
               ...
  
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>What could be wrong?
  I want define a global complexType "<code>variable</code>" as the "<code>BookType</code>" described here:
  <a href="http://www.ibm.com/developerworks/library/xml-schema/#list9" rel="nofollow">http://www.ibm.com/developerworks/library/xml-schema/#list9</a></p>