ValidationType 枚举

定义

指定要执行的验证的类型。Specifies the type of validation to perform.

public enum class ValidationType
public enum ValidationType
type ValidationType = 
Public Enum ValidationType
继承
ValidationType

字段

Auto 1

验证是否找到 DTD 或架构信息。Validates if DTD or schema information is found.

自 .NET Framework 2.0 开始,此字段已过时。Starting with .NET Framework 2.0, this field is obsolete. 它仅适用于已过时的 XmlValidatingReader 类。It applies only to the obsolete XmlValidatingReader class.

DTD 2

根据 DTD 进行验证。Validates according to the DTD.

None 0

未执行任何验证,且未引发验证错误。No validation is performed, and no validation errors are thrown. 此设置创建符合 XML 1.0 的非验证分析程序。This setting creates an XML 1.0 compliant non-validating parser.

ResolveEntity() 调用报告默认属性并解析常规实体。Calls to ResolveEntity() report default attributes and resolve general entities. DOCTYPE 不用于验证目的。The DOCTYPE is not used for validation purposes.

Schema 4

根据 XML 架构定义语言 (XSD) 架构(包括内联 XML 架构)进行验证。Validate according to XML Schema definition language (XSD) schemas, including inline XML Schemas. 通过使用 schemaLocation 特性或提供的 Schemas 特性将 XSD 架构和命名空间 URI 关联起来。XML Schemas are associated with namespace URIs either by using the schemaLocation attribute or the provided Schemas property.

XDR 3

根据 XML 数据简化 (XDR) 架构(包括内联 XDR 架构)进行验证。Validate according to XML-Data Reduced (XDR) schemas, including inline XDR schemas. 使用 x-schema 命名空间前缀或 Schemas 属性识别 XDR 架构。XDR schemas are recognized using the x-schema namespace prefix or the Schemas property.

自 .NET Framework 2.0 开始,此字段已过时。Starting with .NET Framework 2.0, this field is obsolete. 它仅适用于已过时的 XmlValidatingReader 类。It applies only to the obsolete XmlValidatingReader class.

注解

XmlReader 类可以使用架构或文档类型定义(DTD)强制进行验证。The XmlReader class can enforce validation using a schema or document type definition (DTD). ValidationType 枚举指定创建的 XmlReader 实例应该执行的验证类型。The ValidationType enumeration specifies the type of validation the created XmlReader instance should perform. XmlReader 实例可以是通过 Create 方法创建的 XmlReader 对象或 XmlValidatingReader 对象。The XmlReader instance can be either a validating XmlReader object created by the Create method, or an XmlValidatingReader object.

验证模型有三个特征: strict、信息性和状态。The validation model has three characteristics, strict, informative, and status. 严格,不允许混合使用验证类型,如果找不到架构或文档类型定义(DTD),则信息提供警告,如果无法对架构中的元素和属性执行验证,则状态将提供警告。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.

适用于

另请参阅