title: Xml and xsd comparison using java
body: <p>Currently i am using xmlunit to verify my xml file with the schema definition.
  The problem i am facing is my schema has been defined at an element level because of which while validating i am getting false. The same xml verification with xsd workd fine in altova.</p>
  
  <p>Can anyone please suggest me the correct way to reach my goal.
  Here is my present code.</p>
  
  <pre><code>InputSource is = new InputSource(new FileInputStream("give xml file here"));
  Validator v = new Validator(is);
  v.useXMLSchema(true);
  v.setJAXP12SchemaSource(new File("Give scema here"));
  boolean isValid = v.isValid();
  </code></pre>
  
  <p>Thanks in advance.</p>