title: Problem validating against an XSD with Java5
body: <p>I'm trying to validate an Atom feed with Java 5 (JRE 1.5.0 update 11). The code I have works without problem in Java 6, but fails when running in Java 5 with a</p>
  
  <pre><code>org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'xml:base' to a(n) 'attribute declaration' component.
  </code></pre>
  
  <p>I think I remember reading something about the version of Xerces bundled with Java 5 having some problems with some schemas, but i cant find the workaround. Is it a known problem ? Do I have some error in my code ?</p>
  
  <pre><code>public static void validate() throws SAXException, IOException {
      List&lt;Source&gt; schemas = new ArrayList&lt;Source&gt;();
      schemas.add(new StreamSource(AtomValidator.class.getResourceAsStream("/atom.xsd")));
      schemas.add(new StreamSource(AtomValidator.class.getResourceAsStream("/dc.xsd")));
  
      // Lookup a factory for the W3C XML Schema language
      SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
  
      // Compile the schemas.
      Schema schema = factory.newSchema(schemas.toArray(new Source[schemas.size()]));
      Validator validator = schema.newValidator();
  
      // load the file to validate
      Source source = new StreamSource(AtomValidator.class.getResourceAsStream("/sample-feed.xml"));
  
      // check the document
      validator.validate(source);
  }
  </code></pre>
  
  <p><strong>Update :</strong> I tried the method below, but I still have the same problem if I use Xerces 2.9.0. I also tried adding xml.xsd to the list of schemas (as xml:base is defined in xml.xsd) but this time I have </p>
  
  <pre><code>Exception in thread "main" org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not &lt;xsd:schema&gt;.
  </code></pre>
  
  <p><strong>Update 2:</strong> I tried to configure a proxy with the VM arguments <code>-Dhttp.proxyHost=&lt;proxy.host.com&gt; -Dhttp.proxyPort=8080</code> and now it works. I'll try to post a "real answer" from home.</p>
  
  <p><em>and sorry, I cant reply as a comment : because of security reasons XHR is disabled from work ...</em></p>