title: StreamSource problem with FileInputStream vs File
body: <p>SAX error if StreamSource(FileInputStream) but StreamSource(File) ok</p>
  
  <p>Hi, I encountered a StreamSource issue when the parameter was FileInputStream.
  When the parameter was File, it's ok.</p>
  
  <pre><code> public int initXSD (String xsdFile) {
  
          // no error at all if File
    Source schemaFile = new StreamSource(new File(xsdFile));
  
          // sax error at newSchema() if FileInputStream
    Source schemaFile = new StreamSource( new FileInputStream(new File(xsdFile))); 
  
    SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
  
  
       Schema schema = factory.newSchema(schemaFile);
    validator = schema.newValidator();
    return 0;
   }
  </code></pre>
  
  <p>as soon as i changed the StreamSource line to take a FileInputStream:</p>
  
  <pre><code>Source schemaFile = new StreamSource( new FileInputStream(new File(xsdFile)));
  </code></pre>
  
  <p>I got a sax error at newSchema():</p>
  
  <pre><code>org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 's:ComplexObjectType' to a(n) 'type definition' component.
  </code></pre>