title: Validate xsd against xml
body: <p>I have just finished studying xml and xsd. I made my first xml document and I just want to make sure that I'm validating it right using xsd.</p>
  
  <p><strong>My xml code:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;user xmlns="http://localhost" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://localhost user.xsd"&gt;
  &lt;name&gt;
      &lt;first&gt;jack&lt;/first&gt;
      &lt;last&gt;hals&lt;/last&gt;
  &lt;/name&gt;
  &lt;name&gt;
      &lt;first&gt;harry&lt;/first&gt;
      &lt;last&gt;potter&lt;/last&gt;
  &lt;/name&gt;
  &lt;/user&gt;
  </code></pre>
  
  <p><strong>My xsd code:</strong></p>
  
  <pre><code>&lt;?xml vesion="1.0" encoding="UTF-8" ?&gt;&lt;xs:schema xmlns:xs="http://WWW.W3.org/2001/XMLSchema" targetNamespace="http://localhost" xmlns="http://localhost" elementFormDefault="qualified"&gt;
  &lt;xs:element name="user" block="substitution" minOccurs="1" maxOccurs="1"&gt;
  &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
          &lt;xs:element name="name" minOccurs="1" maxOccurs="5" block="substitution"&gt;
              &lt;xs:complexType&gt;
                  &lt;xs:sequence&gt;
                      &lt;xs:element name="first" type="xs:string" default="jack" minOccurs="1" maxOccurs="1" block="substitution" /&gt;
                      &lt;xs:element name="last" type="xs:string" default="hals" minOccurs="1" maxOccurs="1" block="substitution" /&gt;
                  &lt;/xs:sequence&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 have tried an online validator and it said: <code>A pseudo attribute name is expected.</code></p>
  
  <p>What to do now?</p>