Export (0) Print
Expand All
2 out of 2 rated this helpful - Rate this topic

Extensions.Validate Method

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 method Static member Validate(XDocument, XmlSchemaSet, ValidationEventHandler) This method validates that an XDocument conforms to an XSD in an XmlSchemaSet.
Public method Static member Validate(XAttribute, XmlSchemaObject, XmlSchemaSet, ValidationEventHandler) This method validates that an XAttribute conforms to a specified XmlSchemaObject and an XmlSchemaSet.
Public method Static member Validate(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).
Public method Static member Validate(XElement, XmlSchemaObject, XmlSchemaSet, ValidationEventHandler) This method validates that an XElement sub-tree conforms to a specified XmlSchemaObject and an XmlSchemaSet.
Public method Static member Validate(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).
Public method Static member Validate(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).
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).

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.