In an application which uses an XML file, I wish to use XmlSchemaValidator
class to validate this file against the XSD file..
In the example of msdn, (
http://msdn2.microsoft.com/en-us/lib...or(VS.80).aspx )
, before initialising the XmlSchemaValidator, XmlSerializer is initialised.
I saw that if there is a node or attribute which is not valid (to xml
schema), the method XmlSerializer.Deserialize() launches an exception. It
means that before validating this file ( or stream ) its already controlled
by Deserialize method.
I wish to know what is the need to Validate this file against
XmlSchemValidator, if its already controlled ? Will it be efficient, if I
skip this Validation ? If not, why ?
Thanks in advance for the comments
Vivek