XmlValidatingReader Class
Represents a reader that provides document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) validation.
This class is obsolete. Starting with the .NET Framework 2.0, we recommend that you use the XmlReaderSettings class and the XmlReader::Create method to create a validating XML reader.
Assembly: System.Xml (in System.Xml.dll)
[ObsoleteAttribute("Use XmlReader created by XmlReader.Create() method using appropriate XmlReaderSettings instead. http://go.microsoft.com/fwlink/?linkid=14202")] [PermissionSetAttribute(SecurityAction::InheritanceDemand, Name = "FullTrust")] public ref class XmlValidatingReader : XmlReader, IXmlLineInfo, IXmlNamespaceResolver
| Name | Description | |
|---|---|---|
![]() | XmlValidatingReader(Stream^, XmlNodeType, XmlParserContext^) | Initializes a new instance of the XmlValidatingReader class with the specified values. |
![]() | XmlValidatingReader(String^, XmlNodeType, XmlParserContext^) | Initializes a new instance of the XmlValidatingReader class with the specified values. |
![]() | XmlValidatingReader(XmlReader^) | Initializes a new instance of the XmlValidatingReader class that validates the content returned from the given XmlReader. |
| Name | Description | |
|---|---|---|
![]() | AttributeCount | Gets the number of attributes on the current node.(Overrides XmlReader::AttributeCount.) |
![]() | BaseURI | Gets the base URI of the current node.(Overrides XmlReader::BaseURI.) |
![]() | CanReadBinaryContent | Gets a value indicating whether the XmlValidatingReader implements the binary content read methods.(Overrides XmlReader::CanReadBinaryContent.) |
![]() | CanReadValueChunk | Gets a value indicating whether the XmlReader implements the ReadValueChunk method.(Inherited from XmlReader.) |
![]() | CanResolveEntity | Gets a value indicating whether this reader can parse and resolve entities.(Overrides XmlReader::CanResolveEntity.) |
![]() | Depth | Gets the depth of the current node in the XML document.(Overrides XmlReader::Depth.) |
![]() | Encoding | Gets the encoding attribute for the document. |
![]() | EntityHandling | Gets or sets a value that specifies how the reader handles entities. |
![]() | EOF | Gets a value indicating whether the reader is positioned at the end of the stream.(Overrides XmlReader::EOF.) |
![]() | HasAttributes | Gets a value indicating whether the current node has any attributes.(Inherited from XmlReader.) |
![]() | HasValue | Gets a value indicating whether the current node can have a Value other than String.Empty.(Overrides XmlReader::HasValue.) |
![]() | IsDefault | Gets a value indicating whether the current node is an attribute that was generated from the default value defined in the document type definition (DTD) or schema.(Overrides XmlReader::IsDefault.) |
![]() | IsEmptyElement | Gets a value indicating whether the current node is an empty element (for example, <MyElement/>).(Overrides XmlReader::IsEmptyElement.) |
![]() | Item[Int32] | When overridden in a derived class, gets the value of the attribute with the specified index.(Inherited from XmlReader.) |
![]() | Item[String^] | |
![]() | Item[String^, String^] | When overridden in a derived class, gets the value of the attribute with the specified LocalName and NamespaceURI.(Inherited from XmlReader.) |
![]() | LineNumber | Gets the current line number. |
![]() | LinePosition | Gets the current line position. |
![]() | LocalName | Gets the local name of the current node.(Overrides XmlReader::LocalName.) |
![]() | Name | Gets the qualified name of the current node.(Overrides XmlReader::Name.) |
![]() | Namespaces | Gets or sets a value indicating whether to do namespace support. |
![]() | NamespaceURI | Gets the namespace Uniform Resource Identifier (URI) (as defined in the World Wide Web Consortium (W3C) Namespace specification) of the node on which the reader is positioned.(Overrides XmlReader::NamespaceURI.) |
![]() | NameTable | Gets the XmlNameTable associated with this implementation.(Overrides XmlReader::NameTable.) |
![]() | NodeType | Gets the type of the current node.(Overrides XmlReader::NodeType.) |
![]() | Prefix | Gets the namespace prefix associated with the current node.(Overrides XmlReader::Prefix.) |
![]() | QuoteChar | Gets the quotation mark character used to enclose the value of an attribute node.(Overrides XmlReader::QuoteChar.) |
![]() | Reader | Gets the XmlReader used to construct this XmlValidatingReader. |
![]() | ReadState | Gets the state of the reader.(Overrides XmlReader::ReadState.) |
![]() | SchemaInfo | Gets the schema information that has been assigned to the current node as a result of schema validation.(Inherited from XmlReader.) |
![]() | Schemas | Gets a XmlSchemaCollection to use for validation. |
![]() | SchemaType | Gets a schema type object. |
![]() | Settings | Gets the XmlReaderSettings object used to create this XmlReader instance.(Inherited from XmlReader.) |
![]() | ValidationType | Gets or sets a value indicating the type of validation to perform. |
![]() | Value | Gets the text value of the current node.(Overrides XmlReader::Value.) |
![]() | ValueType | Gets The Common Language Runtime (CLR) type for the current node.(Inherited from XmlReader.) |
![]() | XmlLang | Gets the current xml:lang scope.(Overrides XmlReader::XmlLang.) |
![]() | XmlResolver | Sets the XmlResolver used for resolving external document type definition (DTD) and schema location references. The XmlResolver is also used to handle any import or include elements found in XML Schema definition language (XSD) schemas. |
![]() | XmlSpace | Gets the current xml:space scope.(Overrides XmlReader::XmlSpace.) |
| Name | Description | |
|---|---|---|
![]() | Close() | Changes the ReadState to Closed.(Overrides XmlReader::Close().) |
![]() | Dispose() | |
![]() | Dispose(Boolean) | |
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetAttribute(Int32) | Gets the value of the attribute with the specified index.(Overrides XmlReader::GetAttribute(Int32).) |
![]() | GetAttribute(String^) | Gets the value of the attribute with the specified name.(Overrides XmlReader::GetAttribute(String^).) |
![]() | GetAttribute(String^, String^) | Gets the value of the attribute with the specified local name and namespace Uniform Resource Identifier (URI).(Overrides XmlReader::GetAttribute(String^, String^).) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | GetValueAsync() | Asynchronously gets the value of the current node.(Inherited from XmlReader.) |
![]() | HasLineInfo() | Gets a value indicating whether the class can return line information. |
![]() | IsStartElement() | Calls MoveToContent and tests if the current content node is a start tag or empty element tag.(Inherited from XmlReader.) |
![]() | IsStartElement(String^) | Calls MoveToContent and tests if the current content node is a start tag or empty element tag and if the Name property of the element found matches the given argument.(Inherited from XmlReader.) |
![]() | IsStartElement(String^, String^) | Calls MoveToContent and tests if the current content node is a start tag or empty element tag and if the LocalName and NamespaceURI properties of the element found match the given strings.(Inherited from XmlReader.) |
![]() | LookupNamespace(String^) | Resolves a namespace prefix in the current element's scope.(Overrides XmlReader::LookupNamespace(String^).) |
![]() | MemberwiseClone() | |
![]() | MoveToAttribute(Int32) | Moves to the attribute with the specified index.(Overrides XmlReader::MoveToAttribute(Int32).) |
![]() | MoveToAttribute(String^) | Moves to the attribute with the specified name.(Overrides XmlReader::MoveToAttribute(String^).) |
![]() | MoveToAttribute(String^, String^) | Moves to the attribute with the specified local name and namespace Uniform Resource Identifier (URI).(Overrides XmlReader::MoveToAttribute(String^, String^).) |
![]() | MoveToContent() | Checks whether the current node is a content (non-white space text, CDATA, Element, EndElement, EntityReference, or EndEntity) node. If the node is not a content node, the reader skips ahead to the next content node or end of file. It skips over nodes of the following type: ProcessingInstruction, DocumentType, Comment, Whitespace, or SignificantWhitespace.(Inherited from XmlReader.) |
![]() | MoveToContentAsync() | Asynchronously checks whether the current node is a content node. If the node is not a content node, the reader skips ahead to the next content node or end of file.(Inherited from XmlReader.) |
![]() | MoveToElement() | Moves to the element that contains the current attribute node.(Overrides XmlReader::MoveToElement().) |
![]() | MoveToFirstAttribute() | Moves to the first attribute.(Overrides XmlReader::MoveToFirstAttribute().) |
![]() | MoveToNextAttribute() | Moves to the next attribute.(Overrides XmlReader::MoveToNextAttribute().) |
![]() | Read() | Reads the next node from the stream.(Overrides XmlReader::Read().) |
![]() | ReadAsync() | Asynchronously reads the next node from the stream.(Inherited from XmlReader.) |
![]() | ReadAttributeValue() | Parses the attribute value into one or more Text, EntityReference, or EndEntity nodes.(Overrides XmlReader::ReadAttributeValue().) |
![]() | ReadContentAs(Type^, IXmlNamespaceResolver^) | Reads the content as an object of the type specified.(Inherited from XmlReader.) |
![]() | ReadContentAsAsync(Type^, IXmlNamespaceResolver^) | Asynchronously reads the content as an object of the type specified.(Inherited from XmlReader.) |
![]() | ReadContentAsBase64(array<Byte>^, Int32, Int32) | Reads the content and returns the Base64 decoded binary bytes.(Overrides XmlReader::ReadContentAsBase64(array<Byte>^, Int32, Int32).) |
![]() | ReadContentAsBase64Async(array<Byte>^, Int32, Int32) | Asynchronously reads the content and returns the Base64 decoded binary bytes.(Inherited from XmlReader.) |
![]() | ReadContentAsBinHex(array<Byte>^, Int32, Int32) | Reads the content and returns the BinHex decoded binary bytes.(Overrides XmlReader::ReadContentAsBinHex(array<Byte>^, Int32, Int32).) |
![]() | ReadContentAsBinHexAsync(array<Byte>^, Int32, Int32) | Asynchronously reads the content and returns the BinHex decoded binary bytes.(Inherited from XmlReader.) |
![]() | ReadContentAsBoolean() | Reads the text content at the current position as a Boolean.(Inherited from XmlReader.) |
![]() | ReadContentAsDateTime() | |
![]() | ReadContentAsDateTimeOffset() | Reads the text content at the current position as a DateTimeOffset object.(Inherited from XmlReader.) |
![]() | ReadContentAsDecimal() | |
![]() | ReadContentAsDouble() | Reads the text content at the current position as a double-precision floating-point number.(Inherited from XmlReader.) |
![]() | ReadContentAsFloat() | Reads the text content at the current position as a single-precision floating point number.(Inherited from XmlReader.) |
![]() | ReadContentAsInt() | Reads the text content at the current position as a 32-bit signed integer.(Inherited from XmlReader.) |
![]() | ReadContentAsLong() | Reads the text content at the current position as a 64-bit signed integer.(Inherited from XmlReader.) |
![]() | ReadContentAsObject() | |
![]() | ReadContentAsObjectAsync() | |
![]() | ReadContentAsString() | |
![]() | ReadContentAsStringAsync() | |
![]() | ReadElementContentAs(Type^, IXmlNamespaceResolver^) | Reads the element content as the requested type.(Inherited from XmlReader.) |
![]() | ReadElementContentAs(Type^, IXmlNamespaceResolver^, String^, String^) | Checks that the specified local name and namespace URI matches that of the current element, then reads the element content as the requested type.(Inherited from XmlReader.) |
![]() | ReadElementContentAsAsync(Type^, IXmlNamespaceResolver^) | Asynchronously reads the element content as the requested type.(Inherited from XmlReader.) |
![]() | ReadElementContentAsBase64(array<Byte>^, Int32, Int32) | Reads the element and decodes the Base64 content.(Overrides XmlReader::ReadElementContentAsBase64(array<Byte>^, Int32, Int32).) |
![]() | ReadElementContentAsBase64Async(array<Byte>^, Int32, Int32) | Asynchronously reads the element and decodes the Base64 content.(Inherited from XmlReader.) |
![]() | ReadElementContentAsBinHex(array<Byte>^, Int32, Int32) | Reads the element and decodes the BinHex content.(Overrides XmlReader::ReadElementContentAsBinHex(array<Byte>^, Int32, Int32).) |
![]() | ReadElementContentAsBinHexAsync(array<Byte>^, Int32, Int32) | Asynchronously reads the element and decodes the BinHex content.(Inherited from XmlReader.) |
![]() | ReadElementContentAsBoolean() | |
![]() | ReadElementContentAsBoolean(String^, String^) | |
![]() | ReadElementContentAsDateTime() | |
![]() | ReadElementContentAsDateTime(String^, String^) | |
![]() | ReadElementContentAsDecimal() | |
![]() | ReadElementContentAsDecimal(String^, String^) | |
![]() | ReadElementContentAsDouble() | Reads the current element and returns the contents as a double-precision floating-point number.(Inherited from XmlReader.) |
![]() | ReadElementContentAsDouble(String^, String^) | Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a double-precision floating-point number.(Inherited from XmlReader.) |
![]() | ReadElementContentAsFloat() | Reads the current element and returns the contents as single-precision floating-point number.(Inherited from XmlReader.) |
![]() | ReadElementContentAsFloat(String^, String^) | Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a single-precision floating-point number.(Inherited from XmlReader.) |
![]() | ReadElementContentAsInt() | Reads the current element and returns the contents as a 32-bit signed integer.(Inherited from XmlReader.) |
![]() | ReadElementContentAsInt(String^, String^) | Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 32-bit signed integer.(Inherited from XmlReader.) |
![]() | ReadElementContentAsLong() | Reads the current element and returns the contents as a 64-bit signed integer.(Inherited from XmlReader.) |
![]() | ReadElementContentAsLong(String^, String^) | Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 64-bit signed integer.(Inherited from XmlReader.) |
![]() | ReadElementContentAsObject() | |
![]() | ReadElementContentAsObject(String^, String^) | |
![]() | ReadElementContentAsObjectAsync() | |
![]() | ReadElementContentAsString() | |
![]() | ReadElementContentAsString(String^, String^) | |
![]() | ReadElementContentAsStringAsync() | |
![]() | ReadElementString() | Reads a text-only element. However, we recommend that you use the ReadElementContentAsString() method instead, because it provides a more straightforward way to handle this operation.(Inherited from XmlReader.) |
![]() | ReadElementString(String^) | Checks that the Name property of the element found matches the given string before reading a text-only element. However, we recommend that you use the ReadElementContentAsString() method instead, because it provides a more straightforward way to handle this operation.(Inherited from XmlReader.) |
![]() | ReadElementString(String^, String^) | Checks that the LocalName and NamespaceURI properties of the element found matches the given strings before reading a text-only element. However, we recommend that you use the ReadElementContentAsString(String^, String^) method instead, because it provides a more straightforward way to handle this operation.(Inherited from XmlReader.) |
![]() | ReadEndElement() | Checks that the current content node is an end tag and advances the reader to the next node.(Inherited from XmlReader.) |
![]() | ReadInnerXml() | When overridden in a derived class, reads all the content, including markup, as a string.(Inherited from XmlReader.) |
![]() | ReadInnerXmlAsync() | Asynchronously reads all the content, including markup, as a string.(Inherited from XmlReader.) |
![]() | ReadOuterXml() | When overridden in a derived class, reads the content, including markup, representing this node and all its children.(Inherited from XmlReader.) |
![]() | ReadOuterXmlAsync() | Asynchronously reads the content, including markup, representing this node and all its children.(Inherited from XmlReader.) |
![]() | ReadStartElement() | Checks that the current node is an element and advances the reader to the next node.(Inherited from XmlReader.) |
![]() | ReadStartElement(String^) | |
![]() | ReadStartElement(String^, String^) | Checks that the current content node is an element with the given LocalName and NamespaceURI and advances the reader to the next node.(Inherited from XmlReader.) |
![]() | ReadString() | Reads the contents of an element or text node as a string.(Overrides XmlReader::ReadString().) |
![]() | ReadSubtree() | Returns a new XmlReader instance that can be used to read the current node, and all its descendants.(Inherited from XmlReader.) |
![]() | ReadToDescendant(String^) | |
![]() | ReadToDescendant(String^, String^) | |
![]() | ReadToFollowing(String^) | Reads until an element with the specified qualified name is found.(Inherited from XmlReader.) |
![]() | ReadToFollowing(String^, String^) | Reads until an element with the specified local name and namespace URI is found.(Inherited from XmlReader.) |
![]() | ReadToNextSibling(String^) | Advances the XmlReader to the next sibling element with the specified qualified name.(Inherited from XmlReader.) |
![]() | ReadToNextSibling(String^, String^) | Advances the XmlReader to the next sibling element with the specified local name and namespace URI.(Inherited from XmlReader.) |
![]() | ReadTypedValue() | Gets the common language runtime type for the specified XML Schema definition language (XSD) type. |
![]() | ReadValueChunk(array<Char>^, Int32, Int32) | Reads large streams of text embedded in an XML document.(Inherited from XmlReader.) |
![]() | ReadValueChunkAsync(array<Char>^, Int32, Int32) | Asynchronously reads large streams of text embedded in an XML document.(Inherited from XmlReader.) |
![]() | ResolveEntity() | Resolves the entity reference for EntityReference nodes.(Overrides XmlReader::ResolveEntity().) |
![]() | Skip() | Skips the children of the current node.(Inherited from XmlReader.) |
![]() | SkipAsync() | Asynchronously skips the children of the current node.(Inherited from XmlReader.) |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | ValidationEventHandler | Sets an event handler for receiving information about document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) schema validation errors. |
| Name | Description | |
|---|---|---|
![]() ![]() | IXmlNamespaceResolver::GetNamespacesInScope(XmlNamespaceScope) | This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IXmlNamespaceResolver::GetNamespacesInScope. |
![]() ![]() | IXmlNamespaceResolver::LookupNamespace(String^) | This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IXmlNamespaceResolver::LookupNamespace. |
![]() ![]() | IXmlNamespaceResolver::LookupPrefix(String^) | This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IXmlNamespaceResolver::LookupPrefix. |
XmlValidatingReader implements the XmlReader class and provides support for data validation. Use the Schemas property to have the reader validate by using schema files that are cached in an XmlSchemaCollection. The ValidationType property specifies what type of validation the reader should perform. Setting the property to ValidationType.None creates a non-validating reader.
XmlValidatingReader throws an 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 ReadState property to check whether a reader is in error state.
Note |
|---|
The XmlValidatingReader class is obsolete in .NET Framework 2.0. You can create a validating XmlReader instance by using the XmlReaderSettings class and the Create method. For more information, see the Remarks section of the XmlReader reference page. |
Notes to Inheritors:
This class has an inheritance demand. Full trust is required to inherit from XmlValidatingReader.
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.






