title: Getting errors for XSD attribute
body: <p>Hello guys i'm learning how to validate XML files but i'm getting errors for the attribute part. So this is my XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO88591"?&gt;
  
  &lt;feedback xs:noNamespaceSchemaLocation = "Num1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"&gt;
  
  &lt;studentemail&gt;s1@uom.ac.mu&lt;/studentemail&gt;
  
  &lt;modulename code="CSE2041"&gt;Web Tech II&lt;/modulename&gt;
  
  &lt;moduleyear&gt;2010&lt;/moduleyear&gt;
  
  &lt;classsize&gt;Adequate&lt;/classsize&gt;
  
  &lt;/feedback&gt;
  </code></pre>
  
  <p>And this is the XSD:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
  &lt;xs:element name="feedback"&gt;
  &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
  
  &lt;xs:element name="studentemail" type="xs:string"/&gt;
  
  &lt;xs:element name="modulename" type="xs:string"&gt;
  &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
  
  &lt;xs:element name="moduleyear" type="xs:integer"/&gt;
  &lt;xs:element name="classsize" type="xs:string"/&gt;
  
  &lt;/xs:sequence&gt;
  &lt;xs:attribute name="code" type="xs:string"/&gt; //errors
  &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>The error messages are:
  <p>Errors in the XML document: 
      <br/>4: 52  cvc-complex-type.2.3: Element 'modulename' cannot have character [children], because the type's content type is element-only.
      <br/>4: 52  cvc-complex-type.2.4.b: The content of element 'modulename' is not complete. One of '{"":moduleyear}' is expected.
      <br/>5: 13  cvc-complex-type.2.4.d: Invalid content was found starting with element 'moduleyear'. No child element is expected at this point.</p>
  
  <p>Errors in file xml-schema: 
      <br/>10:    48  src-element.3: Element 'modulename' has both a 'type' attribute and a 'anonymous type' child. Only one of these is allowed for an element.</p>
  
  <p>Please help me out. Thanks.</p>