OpenXmlValidator.Validate Method (OpenXmlElement)
Validates the specified element.
Namespace: DocumentFormat.OpenXml.Validation
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
Syntax
'Declaration
Public Function Validate ( _
openXmlElement As OpenXmlElement _
) As IEnumerable(Of ValidationErrorInfo)
'Usage
Dim instance As OpenXmlValidator
Dim openXmlElement As OpenXmlElement
Dim returnValue As IEnumerable(Of ValidationErrorInfo)
returnValue = instance.Validate(openXmlElement)
public IEnumerable<ValidationErrorInfo> Validate(
OpenXmlElement openXmlElement
)
Parameters
- openXmlElement
Type: DocumentFormat.OpenXml.OpenXmlElement
The target OpenXmlElement.
Return Value
Type: System.Collections.Generic.IEnumerable<ValidationErrorInfo>
A set of validation erros.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when the "openXmlElement" parameter is null. |
ArgumentOutOfRangeException | Thrown when the "openXmlElement" is type of OpenXmlUnknownElement, OpenXmlMiscNode, AlternateContent, AlternateContentChoice or AlternateContentFallback. |
InvalidOperationException | Thrown when the "openXmlElement" is not defined in the specified FileFormat. |