using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml.Schema;
public class MainClass
{
public static void Main()
{
XDocument doc = XDocument.Load("xml file");
XmlSchemaSet schema = new XmlSchemaSet();
schema.Add(null, "schema file");
ValidationEventHandler handler = new ValidationEventHandler(MyHandler);
doc.Validate(schema, handler);
}
public static void MyHandler(object sender, ValidationEventArgs e)
{
Console.WriteLine(e.Message);
}
}
|