7 public static void Main ()
9 new DomDumper ().TestOASIS ();
12 public void TestOASIS ()
14 XmlDocument doc = new XmlDocument ();
15 foreach (FileInfo fi in
16 new DirectoryInfo (@"xml-test-suite/xmlconf/oasis").GetFiles ("*.xml")) {
18 if (fi.Name.IndexOf ("fail") >= 0)
21 Console.WriteLine (fi.Name);
23 XmlTextReader xtr = new XmlTextReader (fi.FullName);
24 xtr.Namespaces = false;
25 xtr.Normalization = true;
31 } catch (XmlException ex) {
32 if (fi.Name.IndexOf ("pass") >= 0)
33 Console.WriteLine ("Incorrectly invalid: " + fi.FullName + "\n" + ex.Message);
38 public void DumpDom (XmlNode n)
40 Console.Write (n.NodeType);
42 Console.Write (n.Prefix);
44 Console.Write (n.Name);
46 Console.Write (n.LocalName);
48 Console.Write (n.NamespaceURI);
50 Console.Write (n.Value);
51 Console.WriteLine (' ');
53 Console.WriteLine ("Attributes::::");
54 Console.Write (n.Attributes != null);
55 if (n.Attributes != null) {
57 Console.Write (n.Attributes.Count);
59 for (int i = 0; i < n.Attributes.Count; i++)
60 DumpDom (n.Attributes [i]);
62 Console.WriteLine (":::Attributes End");
64 Console.WriteLine ("ChildNodes::::");
65 Console.Write (n.ChildNodes != null);
66 if (n.ChildNodes != null) {
68 Console.Write (n.ChildNodes.Count);
70 for (int i = 0; i < n.ChildNodes.Count; i++)
71 DumpDom (n.ChildNodes [i]);
73 Console.WriteLine (":::ChildNodes End");