Reports / Validating XML
Still working on the reporting. I can generate about half of a report right now. I need to re-work some of the interpreter code to save more information about test results. Once I do that I’ll be able to generate a complete report.
Also I wrote some code today so I could validate the OVAL definitions XML. I’m using the XmlValidatingReader Class to do this.
try { XmlValidatingReader vr = new XmlValidatingReader (reader); XmlSchemaCollection sc = new XmlSchemaCollection (); sc.Add("oval", @"oval-schema.xsd"); sc.Add("redhat", @"redhat-schema.xsd"); vr.Schemas.Add (sc); Logger.Log.Info ("Validating..."); vr.ValidationEventHandler += new ValidationEventHandler (ValidateEventHandler); while (vr.Read()) { } } catch (Exception e) { Console.WriteLine (e.Message); }
In theory the code should work but in practice I’m getting an XML Schema error about subtestAttributes. I’ll have to leave this code disabled until I resolve that.