using System; using System.Xml; using System.Xml.Schema; public class XML5a{ public static void Main(string[] argumendid){ if(argumendid.Length!=2){ Console.WriteLine("Kasuta kujul XML5a andmefail.xml skeemifail.xsd"); return; } XmlDocument doc=new XmlDocument(); doc.Load(argumendid[0]); doc.Schemas.Add(null, argumendid[1]); ValidationEventHandler veh=new ValidationEventHandler(veahaldaja); doc.Validate(veh); } public static void veahaldaja(object allikas, ValidationEventArgs e){ Console.WriteLine("{0} {1}", e.Message, e.Exception.LineNumber); } }