System.Xml.XmlValidatingReader Class

Represents a reader that provides document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) validation.

See Also: XmlValidatingReader Members

Syntax

[System.Obsolete("Use XmlReader created by XmlReader.Create() method using appropriate XmlReaderSettings instead.")]
public class XmlValidatingReader : XmlReader, Mono.Xml.IHasXmlParserContext, IXmlLineInfo, IXmlNamespaceResolver

Remarks

XmlValidatingReader implements the System.Xml.XmlReader class and provides support for data validation. Use the XmlValidatingReader.Schemas property to have the reader validate by using schema files that are cached in an System.Xml.Schema.XmlSchemaCollection. The XmlValidatingReader.ValidationType property specifies what type of validation the reader should perform. Setting the property to ValidationType.None creates a non-validating reader.

System.Xml.XmlValidatingReader throws an System.Xml.XmlException on XML parse errors. After an exception is thrown the state of the reader is not predictable. For example, the reported node type may be different than the actual node type of the current node. Use the XmlValidatingReader.ReadState property to check whether a reader is in error state.

Note:

The System.Xml.XmlValidatingReader class is obsolete in dnprdnext. You can create a validating System.Xml.XmlReader instance by using the System.Xml.XmlReaderSettings class and the erload:System.Xml.XmlReader.Create method. For more information, see Validating XML Data with XmlReader.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0