title: How to validate xml file against xsd with namespace
body: <p>I want to validate xml file contain namespace with xsd file.</p>
  
  <p>My xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ArrayOfNumberOfCars xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Api.CarWEB.Services.Cars"&gt;
      &lt;NumberOfCars&gt;
           &lt;Number&gt;417&lt;/Number&gt;
      &lt;/NumberOfCars&gt;
  &lt;/ArrayOfNumberOfCars&gt;
  </code></pre>
  
  <p>My xsd file:</p>
  
  <pre><code>    &lt;xsd:element name="ArrayOfNumberOfCars"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence&gt;
                  &lt;xsd:element minOccurs="1" maxOccurs="1" ref="NumberOfCars" /&gt;
              &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  
      &lt;xsd:element name="NumberOfCars"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence&gt;
                  &lt;xsd:element minOccurs="1" maxOccurs="1" ref="Number" /&gt;
              &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  
      &lt;xsd:element name="Number"&gt;
          &lt;xsd:simpleType&gt;
              &lt;xsd:restriction base="xsd:string"&gt;
                  &lt;xsd:minLength value="0" /&gt;
                  &lt;xsd:maxLength value="15" /&gt;
              &lt;/xsd:restriction&gt;
          &lt;/xsd:simpleType&gt;
      &lt;/xsd:element&gt;
  </code></pre>
  
  <p>Affer call method validate, I got exception bellow:</p>
  
  <pre><code>org.xml.sax.SAXException: javax.xml.stream.XMLStreamException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 86; cvc-elt.1: Cannot find the declaration of element 'ArrayOfNumberOfCars'.
  </code></pre>
  
  <p>Everyone know how to config validate for namespage in xsd file. Please help me.</p>
  
  <p>Thanks</p>