Linq to xml validating schemas
Read(schema Reader, Schema Validation Handler); asset.
After reading this article, we can learn the below points.
It can validate an XML document as it reads and parses the document.
In this example, we demonstrate how to activate such validation.
Visual Studio, when I open the file, validates it against the schema and lists errors perfectly.
Somehow, though, I can't seem to validate it automatically in C# without specifying the schema to validate against like so: Xml Document asset = new Xml Document(); Xml Text Reader schema Reader = new Xml Text Reader("relative Schema Path"); Xml Schema schema = Xml Schema.