title: Validate xml against xsd using Apache commos configuration
body: <p>I am newby of XML.</p>
  
  <p>I using Apache Commons XMLConfiguration for my configuration.</p>
  
  <p>I need a schema based validation.</p>
  
  <p>The xsd is locateded in the resources folder of my java project.</p>
  
  <p><strong>The xml and xsd are not located in the same location</strong>.</p>
  
  <p>Following the <a href="http://commons.apache.org/proper/commons-configuration/userguide_v1.10/howto_xml.html#Validation_of_XML_configuration_files" rel="nofollow">documentation</a> (that report only an example with DTD). I  produce the following code:</p>
  
  <pre><code>    URL urlXsd = getClass().getResource("config.xsd");
      DefaultEntityResolver resolver = new DefaultEntityResolver();
      resolver.registerEntityId("configuration", urlXsd);
  
      XMLConfiguration xmlConfig = new XMLConfiguration();
      xmlConfig.setEntityResolver(resolver);
      xmlConfig.setSchemaValidation(true);
  
       xmlConfig.load(new File("config.xml"));
  </code></pre>
  
  <p>I get following exception:</p>
  
  <pre><code>Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 16; cvc-elt.1: Cannot find the declaration of element 'configuration'.
  </code></pre>
  
  <p>My config.xsd:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
     &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"&gt;
           &lt;xs:element name="configuration"&gt;
                 &lt;xs:complexType&gt;
                       &lt;xs:sequence&gt;
                             &lt;xs:element name="reader"&gt;
                             &lt;/xs:element&gt;
                             &lt;xs:element name="writer"&gt;
                             &lt;/xs:element&gt;
                       &lt;/xs:sequence&gt;
                 &lt;/xs:complexType&gt;
           &lt;/xs:element&gt;
     &lt;/xs:schema&gt;
  </code></pre>
  
  <p>My config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &lt;configuration&gt;
     &lt;reader&gt;
     &lt;/reader&gt;
     &lt;writer&gt;
     &lt;/writer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Can anyone help me?</p>