Validating xml with xsd
by Domenico Briganti is licensed under a Creative Commons Attribuzione 3.0 Unported License.
Permissions beyond the scope of this license may be available at [email protected]
The Validation Type property of the Xml Reader Settings object is set to to enforce validation of the XML document by the Create method of the Xml Reader object.
A Validation Event Handler is added to the Xml Reader Settings object to handle any Warning or Error events raised by errors found during the validation process of both the XML document and the schema.
Errors in XML documents will stop your XML applications.
The W3C XML specification states that a program should stop processing an XML document if it finds an error.
Your schema validates the XML nodes that are in your namespace.
If any validation error occurs, an exception is thrown, and the Xml Validating Reader cannot be restarted. NET framework classes support the W3C XML schema recommendation.
The classes used to validate the XML document are Xml Text Reader, Xml Schema Collection, and Xml Validating Reader.
If the XSD is publicly available using HTTP and referenced through a "schema Location" or "no Namespace Schema Location", then the validator will pick it up and it doesn't need to be specified/uploaded.
*The maximum size limit for file upload is 2 megabytes.