You can pass document type definition (DTD) information that is used to resolve entities and add default attributes by using the Xml Parser Context class.
New nodes not returned from the underlying reader may be added by this reader (for example, default attributes and the children of an entity reference).
Any properties set on the given Xml Text Reader also apply to this validating reader.
XML Schema definition language (XSD) schema validation is implemented using the validity constraints defined in the World Wide Web Consortium (W3C) XML Schema Recommendation. NET Framework supports the W3C XML Schema 2001 Recommendation. Each XML Schema is associated with a namespace URI.
The Xml Validating Reader can use the XML Schema (XSD) schema Location attribute in the data file that is bound to the XML Schema instance namespace,
Argument Exception occurs if the Validation Type property is set to DTD and the Xml Parser Context does not contain any DTD properties.
For more information, see the Remarks section of the Xml Reader reference page.The Xml Parser Context constructor containing the public, literal, system literal, and internal DTD subset is required if Validation Type property is DTD or Auto, and resolving entities and adding default attributes is important.For all other validation types, the Xml Parser Context without DTD properties can be supplied (such as schemas).It skips over nodes of the following type: Processing Instruction, Document Type, Comment, Whitespace, or Significant Whitespace.When overridden in a derived class, reads the contents of an element or text node as a string.Any schemas used to validate the XML fragment must be either added to the Xml Schema Collection or referenced directly inside the XML fragment.