Chapter 3. XML Data Validation

The base XML reader examined in Chapter 2—the XmlTextReader class—does not enable you to validate the contents of an XML source against a schema. The correctness of XML documents can be measured using two distinct and complementary metrics: the well-formedness of the document and the validity. Well-formedness of the document refers to the overall syntax of the document. Validation applies at a deeper level and involves the semantics of the document, which must be compliant with a user-defined layout.

The XmlTextReader class ensures only that the document being processed is syntactically correct. By design, the XmlTextReader class deliberately avoids making a more advanced analysis of the nodes in the document and ...

Get Applied XML Programming for Microsoft® .NET 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.