title: XML validation fails on attributes
body: <p>I've some problem validating an xml against a schema that i defined. The weird thing is that the validation fails only if I use the default namespace <code>xmlns="http://retis.sssup.it/duck-lab"</code> while it works like a charm if I define it like <code>xmlns:dl="http://retis.sssup.it/duck-lab"</code>. </p>
  
  <p>When I use the empty namespace the validation fails only on the attributes with the following messages:</p>
  
  <pre><code>cvc-complex-type.3.2.2: Attribute 'data_len' is not allowed to appear in element 'data'.    
  cvc-complex-type.4: Attribute 'data_len' must appear on element 'data'.
  </code></pre>
  
  <p>VALID XML:</p>
  
  <pre><code>&lt;dl:duck xmlns:dl="http://retis.sssup.it/duck-lab" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://retis.sssup.it/duck-lab ../duck.xsd "&gt;
  ...
          &lt;dl:data dl:data_len="1" dl:data_name="name uint" dl:data_type="uint16" dl:endianess="big-endian"/&gt;
  </code></pre>
  
  <p>INVALID XML:</p>
  
  <pre><code>&lt;duck xmlns="http://retis.sssup.it/duck-lab" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://retis.sssup.it/duck-lab ../duck.xsd "&gt;
  ...
      &lt;data data_len="1" data_name="name uint" data_type="uint16" endianess="big-endian"/&gt;
  </code></pre>
  
  <p><strong>--EDIT--</strong></p>
  
  <p>DUCK.XSD</p>
  
  <pre><code>&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://retis.sssup.it/duck-lab"
      xmlns:dl="http://retis.sssup.it/duck-lab" elementFormDefault="qualified"&gt;
  
      &lt;include schemaLocation="datatypes.xsd"/&gt;
      &lt;include schemaLocation="duck_message.xsd"/&gt;
  
      &lt;complexType name="DuckDefinitionType" block="#all" final="#all"&gt;
          &lt;sequence&gt;
              &lt;element type="dl:MessageType" name="message_description" form="qualified"/&gt;
          &lt;/sequence&gt;
      &lt;/complexType&gt;
  
      &lt;element name="duck" type="dl:DuckDefinitionType" /&gt;
  
  &lt;/schema&gt;
  </code></pre>
  
  <p>DATATYPES.XSD</p>
  
  <pre><code>&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://retis.sssup.it/duck-lab"
      xmlns:dl="http://retis.sssup.it/duck-lab" elementFormDefault="qualified"&gt;
          &lt;attribute name="data_name" type="string"/&gt;
      &lt;attribute name="data_len" type="nonNegativeInteger"/&gt;
      &lt;attribute name="data_type" type="string"/&gt;
      &lt;attribute name="endianess" type="string"/&gt;
          &lt;element name="data"&gt;
          &lt;complexType&gt;
              &lt;attribute ref="dl:data_name" use="required"/&gt;
              &lt;attribute ref="dl:data_len" use="required"/&gt;
              &lt;attribute ref="dl:data_type" use="required"/&gt;
              &lt;attribute ref="dl:endianess" use="required"/&gt;
          &lt;/complexType&gt;
      &lt;/element&gt;
  &lt;/schema&gt;
  </code></pre>
  
  <p>DUCK_MESSAGE.XSD</p>
  
  <pre><code>&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://retis.sssup.it/duck-lab"
      xmlns:dl="http://retis.sssup.it/duck-lab" elementFormDefault="qualified"&gt;
  
      &lt;include schemaLocation="datatypes.xsd"&gt;&lt;/include&gt;
      &lt;complexType name="MessageType"&gt;
          &lt;sequence maxOccurs="unbounded"&gt;
              &lt;element ref="dl:data"&gt;&lt;/element&gt;
          &lt;/sequence&gt; 
      &lt;/complexType&gt;
  &lt;/schema&gt;
  </code></pre>
  
  <p>Obviously I can bypass the problem defining a non empty namespace, but I would like to understand what's wrong.</p>
  
  <p>Thanks a lot.</p>