title: How to declare an attribute ID in XML
body: <p>I'm writing some XML and an XSD as an assignment...
  In my XML i have a tag called <code>a</code> ( not actual name) and attribute called <code>id</code>. Part of my XML is shown below:</p>
  
  <pre><code>    &lt;a id="1"&gt;
      ...........
      &lt;/a&gt;
      &lt;a id="1"&gt;
      ............
      &lt;/a&gt;
  </code></pre>
  
  <p>When I validate using XSD it doesn't give an error....</p>
  
  <pre><code>    &lt;xsd:attribute name="id" type="xsd:string" /&gt;
  </code></pre>
  
  <p>I tried to use xsd:ID as a data type of attribute <code>id</code> but it gave me an error; I couldn't figure out what the problem is.</p>
  
  <p>How can I do this?</p>