title: W3 XML demo not validating - No matching global declaration available for the validation root
body: <p>I am trying to learn how to use extensions in xml schema. I took this example (Example 2 from here: <a href="http://www.w3schools.com/schema/el_extension.asp" rel="nofollow">http://www.w3schools.com/schema/el_extension.asp</a>)</p>
  
  <h2>myschema.xsd</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
  &lt;xs:element name="employee" type="fullpersoninfo"/&gt;
  
  &lt;xs:complexType name="personinfo"&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element name="firstname" type="xs:string"/&gt;
      &lt;xs:element name="lastname" type="xs:string"/&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  
  &lt;xs:complexType name="fullpersoninfo"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="personinfo"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element name="address" type="xs:string"/&gt;
          &lt;xs:element name="city" type="xs:string"/&gt;
          &lt;xs:element name="country" type="xs:string"/&gt;
        &lt;/xs:sequence&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt; 
  
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>and made a demo xml data file:</p>
  
  <h2>data.xml</h2>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  
  &lt;personinfo&gt;
      &lt;firstname&gt;John&lt;/firstname&gt;
      &lt;lastname&gt;Doe&lt;/lastname&gt;
  &lt;/personinfo&gt;
  </code></pre>
  
  <p>But when I try to validate it, I get:</p>
  
  <pre><code>xmllint --schema myschema.xsd data.xml
  &lt;?xml version="1.0"?&gt;
  &lt;personinfo&gt;
      &lt;firstname&gt;John&lt;/firstname&gt;
      &lt;lastname&gt;Doe&lt;/lastname&gt;
  &lt;/personinfo&gt;
  data.xml:3: element personinfo: Schemas validity error : Element 'personinfo': No matching global declaration available for the validation root.
  data.xml fails to validate
  </code></pre>
  
  <p>Can anyone explain what I am doing wrong?</p>