O'Reilly logo

Pro LINQ: Language Integrated Query in C# 2008 by Joseph C. Rattz Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Validation

An XML API would just not be complete without the ability to validate XML. So LINQ to XML has the ability to validate an XML document against an XML schema.

The Extension Methods

LINQ to XML has addressed the need for validation by creating the System.Xml.Schema.Extensions static class, which contains the validation methods. These validation methods are implemented as extension methods.

Prototypes

Here is a list of some of the validation method prototypes available in the System.Xml.Schema.Extensions class:

void Extensions.Validate(this XDocument source, XmlSchemaSet schemas,
  ValidationEventHandler validationEventHandler)

void Extensions.Validate(this XDocument source, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required