title: Type 'http://schemas.domain.com:Ssn' is not declared, or is not a simple type when using multiple schemas
body: <p>I have two schemas, one with main definition of the object, and another one has as definiton for the types that are not simple type (string, int, decimal for example)</p>
  
  <p>that is called common.xsd</p>
  
  <p>When i validate, it adds both schemas but it doesn´t find the types in the included file.</p>
  
  <p>Main.Xsd holds:</p>
  
  <pre><code>&lt;xs:include schemaLocation="Common.xsd"/&gt;
  </code></pre>
  
  <p>and this is the validation function:</p>
  
  <pre><code>XmlReaderSettings settings = new XmlReaderSettings();
  
                  FileStream fileStream = File.OpenRead(xsdFile);
              XmlSchema schema = XmlSchema.Read(File.OpenRead(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Schemas\\Main.xsd")), OnXsdSyntaxError);
              XmlSchema schema2 = XmlSchema.Read(File.OpenRead(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Schemas\\Common.xsd")), OnXsdSyntaxError);
  
  
                  settings.ValidationType = ValidationType.Schema;
                  settings.ValidationFlags |= XmlSchemaValidationFlags.ProcessInlineSchema;
                  settings.ValidationFlags |= XmlSchemaValidationFlags.ProcessSchemaLocation;
                  settings.ValidationFlags |= XmlSchemaValidationFlags.ReportValidationWarnings;
  
                  //þurfum að adda common.xsd líka !
                  settings.Schemas.Add(schema);
                  settings.Schemas.Add(schema2);
                  settings.ValidationEventHandler += new ValidationEventHandler(OnXsdSyntaxError);
  
                  using (XmlReader validator = XmlReader.Create(xmlFile, settings))
                  {
                      while (validator.Read())
                          isValid = true;
                  }
  </code></pre>
  
  <p>The error is:</p>
  
  <p>Type 'http://schemas.domain.com:Ssn' is not declared, or is not a simple type.</p>
  
  <p>So clearly it is not adding the scheme2 file ad therefor not finding definition for this custom types.</p>
  
  <p>I would really appreciate help with this, because i´m forced to use multiple XSD files in this validation.</p>