Export (0) Print
Expand All

XElement.Validate Method

.NET Framework 3.5

Validates that an XDocument, an XElement, or an XAttribute conforms to an XSD in an XmlSchemaSet.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public Extension Method Validate(XmlSchemaObject, XmlSchemaSet, ValidationEventHandler) This method validates that an XElement sub-tree conforms to a specified XmlSchemaObject and an XmlSchemaSet. (Defined by Extensions.)
Public Extension Method Validate(XmlSchemaObject, XmlSchemaSet, ValidationEventHandler, Boolean) Validates that an XElement sub-tree conforms to a specified XmlSchemaObject and an XmlSchemaSet, optionally populating the XML tree with the post-schema-validation infoset (PSVI). (Defined by Extensions.)
Top

These methods use an underlying XmlReader to validate the XML tree against an XSD.

Validation error and warning messages are handled using the ValidationEventHandler delegate. If no event handler is provided to these methods, validation errors are exposed as an XmlSchemaValidationException. Validation warnings do not cause an XmlSchemaValidationException to be thrown.

Some of these extension methods optionally allow population of the post-schema-validation infoset (PSVI).

Community Additions

ADD
Show:
© 2015 Microsoft