Skip to content

Commit ad57332

Browse files
authored
Add note to Validate documentation to specify that it only validates the transitional format (#1917)
- closes #1223 - closes #1190 - closes #1142
1 parent fcc4a00 commit ad57332

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

src/DocumentFormat.OpenXml.Framework/Validation/DocumentValidator.cs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@ public DocumentValidator(ValidationCache cache)
2929
}
3030

3131
/// <summary>
32-
/// Validate the specified document.
32+
/// Validates the specified Open XML package against the provided validation settings.
3333
/// </summary>
34-
/// <param name="document">The document to be validated.</param>
35-
/// <param name="settings">The settings to be used during validation.</param>
36-
/// <param name="token"></param>
37-
/// <returns>Return results in ValidationResult.</returns>
34+
/// <param name="document">The <see cref="OpenXmlPackage"/> to be validated.</param>
35+
/// <param name="settings">The <see cref="ValidationSettings"/> to use during validation.</param>
36+
/// <param name="token">A <see cref="CancellationToken"/> to observe while waiting for the validation to complete.</param>
37+
/// <returns>
38+
/// A list of <see cref="ValidationErrorInfo"/> objects that represent the validation errors found in the package.
39+
/// If no errors are found, the list will be empty.
40+
/// </returns>
41+
/// <remarks>
42+
/// <para><b>Note:</b> This method can only validate transitional Open XML documents. Strict documents are not supported.</para>
43+
/// </remarks>
3844
public List<ValidationErrorInfo> Validate(OpenXmlPackage document, ValidationSettings settings, CancellationToken token)
3945
{
4046
var context = new ValidationContext(document.Features.GetNamespaceResolver(), settings, _cache, token);
@@ -57,12 +63,18 @@ public List<ValidationErrorInfo> Validate(OpenXmlPackage document, ValidationSet
5763
}
5864

5965
/// <summary>
60-
/// Validate the specified part.
66+
/// Validates the specified Open XML part against the provided validation settings.
6167
/// </summary>
62-
/// <param name="part">The OpenXmlPart to be validated.</param>
63-
/// <param name="settings">The settings to be used during validation.</param>
64-
/// <param name="token"></param>
65-
/// <returns></returns>
68+
/// <param name="part">The <see cref="OpenXmlPart"/> to be validated.</param>
69+
/// <param name="settings">The <see cref="ValidationSettings"/> to use during validation.</param>
70+
/// <param name="token">A <see cref="CancellationToken"/> to observe while waiting for the validation to complete.</param>
71+
/// <returns>
72+
/// A list of <see cref="ValidationErrorInfo"/> objects that represent the validation errors found in the part.
73+
/// If no errors are found, the list will be empty.
74+
/// </returns>
75+
/// <remarks>
76+
/// <para><b>Note:</b> This method can only validate transitional Open XML documents. Strict documents are not supported.</para>
77+
/// </remarks>
6678
public List<ValidationErrorInfo> Validate(OpenXmlPart part, ValidationSettings settings, CancellationToken token)
6779
{
6880
var context = new ValidationContext(part.Features.GetNamespaceResolver(), settings, _cache, token);

0 commit comments

Comments
 (0)