Scott Loban demonstrates a method for validating that a dynamic XML document adheres to the rules for document structure and syntax as expressed in a schema.
XML is probably the most fundamental of today's core technologies for implementing distributed applications.
For more information, see Validating XML Data with Xml Reader.
Any properties set on the given Xml Text Reader also apply to this validating reader.
This technique is useful for ensuring that dynamically-generated XML documentssuch as those received or sent by a Web service, passed as a method argument or returned as the result of a database queryare as expected. Schema; try catch (Exception e) where you then create a function called my Callback to handle any actual validation exceptions.None); // s Input contains an entire xml document string Xml Validating Reader o My VReader = new Xml Validating Reader(s Input, Xml Node Type. , which is the same namespace that is used when adding the schema to the xref: System. Xml Schema Set class see, Xml Schema Set for Schema Compilation.