title: XML String Validation with two XSD Strings (with include) / how does LSResourceResolver work?
body: <p>I am trying to validate an XML String against two Strings that contains an XSD. One XSD includes the other. I get the error:
  "Cannot resolve the name 'ServiceSpecificationSchema:ServiceIdentifier' to a(n) 'type definition' component."</p>
  
  <p>It looks like, that my code doesnt recognize the second XSD file. Others solved that problem by using a LSResourceResolver ( seen here: <a href="https://stackoverflow.com/questions/2342808/how-to-validate-an-xml-file-using-java-with-an-xsd-having-an-include/2342859#2342859">How to validate an XML file using Java with an XSD having an include?</a> )</p>
  
  <p>But in that exampe the files are stored local. Is there a good way, that this method works with my XSD strings?</p>
  
  <p>Any hint would be appreciated.</p>
  
  <p>My code so far:</p>
  
  <blockquote>
  <pre><code>        SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
  
          Schema schema = factory.newSchema(new SAXSource[]
                  {
                          (new SAXSource(new InputSource(new StringReader(XSD)))),
                          (new SAXSource(new InputSource(new StringReader(XSD2))))
                  });
          Validator validator = schema.newValidator();
  
          validator.validate(new StreamSource(new StringReader(inputXml)));
  </code></pre>
  </blockquote>