Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)
The XmlValidatingEventArgs object is passed to the event handler for the Validating event, which occurs after changes to a form's underlying XML document have been accepted but before the Changed event has occurred.
The XmlValidatingEventArgs class is derived from the XmlEventArgs class which provides properties that can be used within the event handler to get information about the data that is being validated in the form's underlying XML document and about the node that is being validated. For example, the XmlEventArgs object provides the Site property which gets a reference to an XPathNavigator object that points to the node being validated in the form's underlying XML document. However, note that the underlying XML document is read-only during the Validating event.
In addition to these properties, the XmlValidatingEventArgs class provides the overloaded ReportError method for adding errors to the FormErrorCollection of the form, and to specify custom error information for errors that occur during the Validating event.
The overloaded ReportError method of the XmlValidatingEventArgs class corresponds to the ReportError method of the DataDOMEvent interface in the Microsoft Office InfoPath 2003 managed code object model.