title: Validating XML against XSD java
body: <p>With Xerces, I am getting following Error:</p>
  
  <pre><code>Parsing error:  Document is invalid: no grammar found.
  Parsing error:  Document root element "TXLife", must match DOCTYPE root "null".
  </code></pre>
  
  <p>I have resolved the issue by setting</p>
  
  <pre><code>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ACORD.org/Standards/Life/2 file:///C:/Users/Himanshuy/workspace/XMLUnit/TXLife2.26.00.xsd" xmlns="http://ACORD.org/Standards/Life/2"
  </code></pre>
  
  <p>But now SAXParser is giving incorrect validation error when I compare it with XMLSpy validation error.
  SAXParser is giving me:</p>
  
  <pre><code>Invalid content was found starting with element &lt;element&gt;
  </code></pre>
  
  <p>XMLSpy is telling me:</p>
  
  <pre><code>&lt;element&gt; is not allowed at this location under element &lt;some_parent_element&gt;
  </code></pre>
  
  <p>Here XMLSpy is correct.</p>
  
  <p>How can I get the same result from Java Validation?</p>