This class provides an additional layer between the Xml Reader and the Xml Document.
This method is useful when you need to create a schema from scratch.
But there will be times when you want to create a schema to match an existing object.
A valid XML file is one whose structure conforms to a specification.
This specification can be in the form of an XML schema or a Document Type Definition (DTD), for example.
Any valid XML file is well-formed, but not every well-formed XML file is valid. NET Framework provides good support for validating XML files.
To validate an XML document, you can use the Xml Validating Reader class.
linkid=14202")] 2604[Obsolete("App Domain policy levels are obsolete and will be removed in a future release of the .
Link ID=155570 for more information.")] 4298[Obsolete("App Domain.
DTDs are part of the Standard Generalized Markup Language (SGML) standard, from which both HTML and XML derive.
A DTD file lists the elements that may appear in an XML file, as in this example (Books.dtd): Private Sub Validate It() ' Load a document with an external schema Dim xtr As Xml Text Reader = _ New Xml Text Reader("Books.xml") ' Prepare to validate it Dim xvr As Xml Validating Reader = _ New Xml Validating Reader(xtr) xvr. DTD ' Tell the validator what to do with errors Add Handler xvr.
Load(xvr) End Sub Private Sub Validation Handler( _ By Val sender As Object, _ By Val e As Validation Event Args) ' Dump any validation errors to the UI Message Box. Message) End Sub Schema files are not the only way to describe the structure of an XML file.