Name
XmlValidatingReader
Synopsis
This class is an XML reader that supports DTD and Schema validation. The type of
validation to perform is contained in the ValidationType
property, which can be DTD
, Schema
, XDR
, or Auto
. Auto
is the default and
determines which type of validation is required, if any, based on the document.
If the DOCTYPE
element contains DTD information, that is used. If a
schema attribute exists or there is an inline <schema>
, that schema is used.
This class implements an event handler that you can set to warn
of validation errors during Read()
operations.
Specifically, a delegate instance
of type System.Xml.Schema.ValidationEventHandler
can be set for
the ValidationEventHandler
event in this class. This delegate
instance is invoked whenever the XmlValidatingReader
finds an schema-invalid
construct in the XML document it is reading, giving the delegate a chance to
perform whatever error-handling is appropriate. If no event handler is registered,
a XmlException
is thrown instead on the first error.
Public Class XmlValidatingReader : Inherits XmlReader : Implements IXmlLineInfo ' Public Constructors Public Sub New(ByVal xmlFragment As System.IO.Stream, ByVal fragType As XmlNodeType, ByVal context As XmlParserContext) Public Sub New(ByVal xmlFragment As String, ByVal fragType As XmlNodeType, ByVal context As XmlParserContext) Public Sub New( ByVal reader As XmlReader) ' Public Instance Properties Overrides Public ReadOnly Property AttributeCount As Integer Overrides ...
Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.