public static void TestDir (string masterlist, TextWriter w) { FileInfo fi = new FileInfo (masterlist); string dirname = fi.Directory.Parent.FullName; SchemaDumper d = new SchemaDumper (w); #if false foreach (DirectoryInfo di in new DirectoryInfo (dirname).GetDirectories ()) foreach (FileInfo fi in di.GetFiles ("*.xsd")) { try { d.IndentLine ("**** File : " + fi.Name); d.DumpSchema (XmlSchema.Read (new XmlTextReader (fi.FullName), null)); } catch (Exception ex) { d.IndentLine ("**** Error in " + fi.Name); } } #else XmlDocument doc = new XmlDocument (); doc.Load (fi.FullName); foreach (XmlElement test in doc.SelectNodes ("/tests/test")) { // Test schema string schemaFile = test.SelectSingleNode ("@schema").InnerText; if (schemaFile.Length > 2) schemaFile = schemaFile.Substring (2); bool isValidSchema = test.SelectSingleNode ("@out_s").InnerText == "1"; if (!isValidSchema) continue; #endif try { d.IndentLine ("**** File : " + schemaFile); d.depth++; XmlTextReader xtr = new XmlTextReader (dirname + "/" + schemaFile); d.DumpSchema (XmlSchema.Read (xtr, null)); xtr.Close (); } catch (Exception ex) { d.IndentLine ("**** Error in " + schemaFile); } finally { d.depth--; } } }