title: Referencing a XSD schema within jar file
body: <p>I have two schema files one is imported from the other.  When executing the code in Eclipse schemas are found but when executing the code from jar schema files are not found</p>
  
  <p>here is the code</p>
  
  <pre><code>SAXParserFactory factory = SAXParserFactory.newInstance();
          factory.setNamespaceAware(true);
          factory.setValidating(false);
  
          SchemaFactory schemaFactory = SchemaFactory
                  .newInstance("http://www.w3.org/2001/XMLSchema");
          try {
              factory.setSchema(schemaFactory.newSchema(new Source[] {
                      new StreamSource(getClass().getResource("Liso.xsd")
                              .getFile()),
                      new StreamSource(getClass().getResource("LisoXml.xsd")
                              .getFile()) }));
                  this.saxParser = factory.newSAXParser();
          } catch (SAXException se) {
              System.out.println("SCHEMA : " + se.getMessage()); // problem in the XSD itself
          }
  </code></pre>
  
  <p>and here is the error I get</p>
  
  <pre><code>SCHEMA : schema_reference.4: Failed to read schema document 'file:/C:/Tools/lib/LisoTools.jar!/com/xerox/liso/xml/Liso.xsd', because 1) could not find the do
  cument; 2) the document could not be read; 3) the root element of the document is not &lt;xsd:schema&gt;.
  </code></pre>
  
  <p>Thanks</p>