title: Use a local XSD for an XML document
body: <p>Here is my XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;linii xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="file:///C:/Users/Cosmin/Desktop/MyApplication/app/src/main/res/values/linii.xsd"&gt;
      &lt;linia id="1"&gt;
          &lt;indicativ&gt;19&lt;/indicativ&gt;
          &lt;nume&gt;Auchan&lt;/nume&gt;
          &lt;traseu&gt;1&lt;/traseu&gt;
      &lt;/linia&gt;
  
      &lt;linia id="2"&gt;
          &lt;indicativ&gt;20&lt;/indicativ&gt;
          &lt;nume&gt;Carrefour ERA&lt;/nume&gt;
          &lt;traseu&gt;2&lt;/traseu&gt;
      &lt;/linia&gt;
  &lt;/linii&gt;
  </code></pre>
  
  <p>And my XSD</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema attributeFormDefault="unqualified" 
             elementFormDefault="qualified"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;xs:element name="linii"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name="linia" maxOccurs="unbounded" minOccurs="0"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element type="xs:byte" name="indicativ"/&gt;
                              &lt;xs:element type="xs:string" name="nume"/&gt;
                              &lt;xs:element type="xs:byte" name="traseu"/&gt;
                          &lt;/xs:sequence&gt;
                          &lt;xs:attribute type="xs:byte" name="id" use="optional"/&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Element linii must be declared</p>
  </blockquote>
  
  <p>Why? I'm working in Android Studio.
  <a href="http://www.corefiling.com/opensource/schemaValidate.html" rel="nofollow">CoreFiling</a> validate both, XML and XSD.</p>