+2006-11-09 Atsushi Enomoto <atsushi@ximian.com>
+
+ * NewMonoXSD.cs : Ankit wants good validation error reporting ;-)
+
2006-11-09 Atsushi Enomoto <atsushi@ximian.com>
* NewMonoXSD.cs : process all elements including imported ones. To do
else\r
{\r
foreach (XmlSchema schema in schemas) {\r
- if (!schema.IsCompiled) schema.Compile (null);\r
+ if (!schema.IsCompiled) schema.Compile (new ValidationEventHandler (HandleValidationError));\r
foreach (XmlSchemaElement el in schema.Elements.Values)\r
if (!qnames.Contains (el.QualifiedName))\r
qnames.Add (el.QualifiedName);\r
Console.WriteLine ("Written file " + genFile);\r
}\r
\r
+ void HandleValidationError (object o, ValidationEventArgs e)\r
+ {\r
+ Console.WriteLine ("{0}: {1} {2}",\r
+ e.Severity == XmlSeverityType.Error ? "Error" : "Warning",\r
+ e.Message,\r
+ e.Exception != null ? e.Exception.Message : null);\r
+ }\r
+\r
public void Error (string msg)\r
{\r
throw new ApplicationException (msg);\r