The System.Xml.XmlReader class can enforce validation using a schema or document type definition (DTD). The System.Xml.ValidationType enumeration specifies the type of validation the created System.Xml.XmlReader instance should perform. The System.Xml.XmlReader instance can be either a validating System.Xml.XmlReader object created by the erload:System.Xml.XmlReader.Create method, or an System.Xml.XmlValidatingReader object.
The validation model has three characteristics, strict, informative, and status. Strict, does not allow the mixing of validation types, informative provides a warning if the schema or document type definition (DTD) cannot be found, and status provides warnings if validation cannot be performed for elements and attributes from schemas.
Member Name | Description |
---|---|
Auto |
Validates if DTD or schema information is found. |
DTD |
Validates according to the DTD. |
None |
No validation is performed. This setting creates an XML 1.0 compliant non-validating parser. |
Schema |
Validate according to XML Schema definition language (XSD) schemas, including inline XML Schemas. XML Schemas are associated with namespace URIs either by using the schemaLocation attribute or the provided Schemas property. |
XDR |
Validate according to XML-Data Reduced (XDR) schemas, including inline XDR schemas. XDR schemas are recognized using the x-schema namespace prefix or the XmlValidatingReader.Schemas property. |