Why is the XmlDocument Validate event handler not getting hit?

gz!

New Member
I have this code:\[code\] // Load the document XmlDocument xmlDocument = new XmlDocument(); // use the stream and have it close when it is finished using ( argInputStream ) { xmlDocument.Load( argInputStream ); xmlDocument.Schemas.Add( XmlSchema.Read( argSchemaStream, null ) ); xmlDocument.Validate( ValidationEventHandler ); }// this is not getting hitvoid ValidationEventHandler( object sender, ValidationEventArgs e ){ switch ( e.Severity ) { case XmlSeverityType.Error: Console.WriteLine( "Error: {0}", e.Message ); break; case XmlSeverityType.Warning: Console.WriteLine( "Warning {0}", e.Message ); break; }}\[/code\]top line of my XSD:\[code\]<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">\[/code\]Any ideas?
 
Back
Top