I am not getting expected validation errors when attributes in my xml
are not defined in my schema. Does anyone know if this is normal
behavior? I am however getting the expected validation errors for
things like 'invalid child element', etc...
here's is my code...
XmlSchemaCollection schemaCol = new XmlSchemaCollection();
schemaCol.Add(schemaNamespace, schemaUri);
XmlValidatingReader vr = new XmlValidatingReader(xml,
XmlNodeType.Document, null);
vr.ValidationType = ValidationType.Schema;
if(schemaCol != null)
{
vr.Schemas.Add(schemaCol);
}
vr.ValidationEventHandler += new
ValidationEventHandler(ValidationCallBack);
while(vr.Read())
{
}
vr.Close();