OpenXmlValidator.Validate Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Validate(OpenXmlElement) |
Validates the specified element. |
Validate(OpenXmlPackage) |
Validates the specified document. |
Validate(OpenXmlPart) |
Validates the specified content in the |
Validate(OpenXmlElement, CancellationToken) |
Validates the specified element. |
Validate(OpenXmlPackage, CancellationToken) |
Validates the specified document. |
Validate(OpenXmlPart, CancellationToken) |
Validates the specified content in the |
Validate(OpenXmlElement)
Validates the specified element.
public System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo> Validate (DocumentFormat.OpenXml.OpenXmlElement openXmlElement);
member this.Validate : DocumentFormat.OpenXml.OpenXmlElement -> seq<DocumentFormat.OpenXml.Validation.ValidationErrorInfo>
Public Function Validate (openXmlElement As OpenXmlElement) As IEnumerable(Of ValidationErrorInfo)
Parameters
- openXmlElement
- OpenXmlElement
The target OpenXmlElement.
Returns
A set of validation errors.
Exceptions
Thrown when the openXmlElement
parameter is null.
Thrown when the openXmlElement
is type of OpenXmlUnknownElement, OpenXmlMiscNode, AlternateContent, AlternateContentChoice or AlternateContentFallback.
Thrown when the openXmlElement
is not defined in the specified FileFormat.
Applies to
Validate(OpenXmlPackage)
Validates the specified document.
public System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo> Validate (DocumentFormat.OpenXml.Packaging.OpenXmlPackage openXmlPackage);
member this.Validate : DocumentFormat.OpenXml.Packaging.OpenXmlPackage -> seq<DocumentFormat.OpenXml.Validation.ValidationErrorInfo>
Public Function Validate (openXmlPackage As OpenXmlPackage) As IEnumerable(Of ValidationErrorInfo)
Parameters
- openXmlPackage
- OpenXmlPackage
The target OpenXmlPackage.
Returns
A set of validation errors.
Exceptions
Thrown when the openXmlPackage
parameter is null.
Applies to
Validate(OpenXmlPart)
Validates the specified content in the openXmlPart
.
public System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo> Validate (DocumentFormat.OpenXml.Packaging.OpenXmlPart openXmlPart);
member this.Validate : DocumentFormat.OpenXml.Packaging.OpenXmlPart -> seq<DocumentFormat.OpenXml.Validation.ValidationErrorInfo>
Public Function Validate (openXmlPart As OpenXmlPart) As IEnumerable(Of ValidationErrorInfo)
Parameters
- openXmlPart
- OpenXmlPart
The target OpenXmlPart.
Returns
A set of validation errors.
Exceptions
Thrown when the openXmlPart
parameter is null.
Throw when the specified part is not a defined part in the specified FileFormat version.
Applies to
Validate(OpenXmlElement, CancellationToken)
Validates the specified element.
public System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo> Validate (DocumentFormat.OpenXml.OpenXmlElement openXmlElement, System.Threading.CancellationToken token = default);
member this.Validate : DocumentFormat.OpenXml.OpenXmlElement * System.Threading.CancellationToken -> seq<DocumentFormat.OpenXml.Validation.ValidationErrorInfo>
Public Function Validate (openXmlElement As OpenXmlElement, Optional token As CancellationToken = Nothing) As IEnumerable(Of ValidationErrorInfo)
Parameters
- openXmlElement
- OpenXmlElement
The target OpenXmlElement.
- token
- CancellationToken
Cancellation token
Returns
A set of validation errors.
Exceptions
Thrown when the openXmlElement
parameter is null.
Thrown when the openXmlElement
is type of OpenXmlUnknownElement, OpenXmlMiscNode, AlternateContent, AlternateContentChoice or AlternateContentFallback.
Thrown when the openXmlElement
is not defined in the specified FileFormat.
Applies to
Validate(OpenXmlPackage, CancellationToken)
Validates the specified document.
public System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo> Validate (DocumentFormat.OpenXml.Packaging.OpenXmlPackage openXmlPackage, System.Threading.CancellationToken token = default);
member this.Validate : DocumentFormat.OpenXml.Packaging.OpenXmlPackage * System.Threading.CancellationToken -> seq<DocumentFormat.OpenXml.Validation.ValidationErrorInfo>
Public Function Validate (openXmlPackage As OpenXmlPackage, Optional token As CancellationToken = Nothing) As IEnumerable(Of ValidationErrorInfo)
Parameters
- openXmlPackage
- OpenXmlPackage
The target OpenXmlPackage.
- token
- CancellationToken
Cancellation token
Returns
A set of validation errors.
Exceptions
Thrown when the openXmlPackage
parameter is null.
Applies to
Validate(OpenXmlPart, CancellationToken)
Validates the specified content in the openXmlPart
.
public System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo> Validate (DocumentFormat.OpenXml.Packaging.OpenXmlPart openXmlPart, System.Threading.CancellationToken token = default);
member this.Validate : DocumentFormat.OpenXml.Packaging.OpenXmlPart * System.Threading.CancellationToken -> seq<DocumentFormat.OpenXml.Validation.ValidationErrorInfo>
Public Function Validate (openXmlPart As OpenXmlPart, Optional token As CancellationToken = Nothing) As IEnumerable(Of ValidationErrorInfo)
Parameters
- openXmlPart
- OpenXmlPart
The target OpenXmlPart.
- token
- CancellationToken
Cancellation token
Returns
A set of validation errors.
Exceptions
Thrown when the openXmlPart
parameter is null.
Throw when the specified part is not a defined part in the specified FileFormat version.