ValidationType Enum

Definition

Specifies the type of validation to perform.

public enum ValidationType
Inheritance
ValidationType

Fields

Name Value Description
None 0

No validation is performed, and no validation errors are thrown. This setting creates an XML 1.0 compliant non-validating parser.

Calls to ResolveEntity() report default attributes and resolve general entities. The DOCTYPE is not used for validation purposes.

Auto 1

Validates if DTD or schema information is found.

Starting with .NET Framework 2.0, this field is obsolete. It applies only to the obsolete XmlValidatingReader class.

DTD 2

Validates according to the DTD.

XDR 3

Validate according to XML-Data Reduced (XDR) schemas, including inline XDR schemas. XDR schemas are recognized using the x-schema namespace prefix or the Schemas property.

Starting with .NET Framework 2.0, this field is obsolete. It applies only to the obsolete XmlValidatingReader class.

Schema 4

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.

Remarks

The XmlReader class can enforce validation using a schema or document type definition (DTD). The ValidationType enumeration specifies the type of validation the created XmlReader instance should perform. The XmlReader instance can be either a validating XmlReader object created by the Create method, or an 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.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also