public void v9()
{
bool found = false;
XmlSchemaSet sc = new XmlSchemaSet();
sc.XmlResolver = new XmlUrlResolver();
XmlSchema parent = sc.Add(null, Path.Combine(TestData._Root, "import_v9_a.xsd"));
CError.Compare(sc.IsCompiled, false, "AddIsCompiled");
CError.Compare(sc.Count, 3, "AddCount");
sc.Compile();
CError.Compare(sc.Count, 3, "CompileCount");
CError.Compare(sc.IsCompiled, true, "CompileIsCompiled");
XmlSchema sch_B = sc.Add(null, Path.Combine(TestData._Root, "import_v9_b.xsd")); // should be already present in the set
sc.Add(null, Path.Combine(TestData._Root, "import_v9_c.xsd")); // should be already present in the set
CError.Compare(sc.Count, 3, "Count");
CError.Compare(sc.IsCompiled, true, "IsCompiled");
// check that schema is present in parent.Includes and its NS correct.
foreach (XmlSchemaImport imp in parent.Includes)
if (imp.SchemaLocation.Equals("import_v9_b.xsd") && imp.Schema.TargetNamespace.Equals("ns-b"))
found = true;
if (!found) Assert.True(false);
// check that schema C in sch_b.Includes and its NS correct.
foreach (XmlSchemaImport imp in sch_B.Includes)
if (imp.SchemaLocation.Equals("import_v9_c.xsd") && imp.Schema.TargetNamespace.Equals("ns-c"))
return;
Assert.True(false);
}