Hello,
I have an XML and XSD file. When I do validation in the XML file I only get the first error. Is
it possible to list all errors?
One other question.
-------------Microsoft Sample Code -------------------
XmlReaderSettings settings = new XmlReaderSettings();
settings.Schemas.Add("http://www.contoso.com/books", "contosoBooks.xsd");
settings.ValidationType = ValidationType.Schema;
XmlReader reader = XmlReader.Create("contosoBooks.xml", settings);
XmlDocument document = new XmlDocument();
document.Load(reader);
ValidationEventHandler eventHandler = new ValidationEventHandler(ValidationEventHandler);
document.Validate(eventHandler);
-----------------http://msdn.microsoft.com/en-us/library/ms162371.aspx ---------------
What is the point of first creating a XmlReader and passing in the XmlReaderSettings ?
Wouldn't it be easier to just use something like this:
----------------------------------------------
XmlDocument document = new XmlDocument();
document.Load(Filename)
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
document.Schemas.Add(settings.Schemas.Add(null, "contosoBooks.xml"));
ValidationEventHandler eventHandler = new ValidationEventHandler(ValidationEventHandler);
document.Validate(eventHandler);
----------------------------------------------
Am I missing something? What is the point of loading in the reader first.
Thank you for taking the time to read this.
--
Adhal Freeware
http://www.adhal.org
There are only 10 types of people in the world: Those who understand binary, and those who don't.