Extensions.Validate Method

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Xml.Schema
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticValidate(XAttribute, XmlSchemaObject, XmlSchemaSet, ValidationEventHandler)

This method validates that an XAttribute conforms to a specified XmlSchemaObject and an XmlSchemaSet.

System_CAPS_pubmethodSystem_CAPS_staticValidate(XAttribute, XmlSchemaObject, XmlSchemaSet, ValidationEventHandler, Boolean)

Validates that an XAttribute conforms to a specified XmlSchemaObject and an XmlSchemaSet, optionally populating the XML tree with the post-schema-validation infoset (PSVI).

System_CAPS_pubmethodSystem_CAPS_staticValidate(XDocument, XmlSchemaSet, ValidationEventHandler)

This method validates that an XDocument conforms to an XSD in an XmlSchemaSet.

System_CAPS_pubmethodSystem_CAPS_staticValidate(XDocument, XmlSchemaSet, ValidationEventHandler, Boolean)

Validates that an XDocument conforms to an XSD in an XmlSchemaSet, optionally populating the XML tree with the post-schema-validation infoset (PSVI).

System_CAPS_pubmethodSystem_CAPS_staticValidate(XElement, XmlSchemaObject, XmlSchemaSet, ValidationEventHandler)

This method validates that an XElement sub-tree conforms to a specified XmlSchemaObject and an XmlSchemaSet.

System_CAPS_pubmethodSystem_CAPS_staticValidate(XElement, 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).

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).

Return to top
Show: