Sdílet prostřednictvím


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

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.

See Also

Reference

OpenXmlValidator Class

OpenXmlValidator Members

Validate Overload

DocumentFormat.OpenXml.Validation Namespace