The current BaseX test driver uses the BaseX validation module. This approach has limitations, for example, an older version of Xerces is used.
This approach also implies that validation is only executed as part of a regular assertion. In general, assertions are written assuming that the XML documents under test are valid. Invalid documents will often have side effects on unrelated assertions and can confuse the user. In general, only XML documents that are valid against a schema should be tested by an Executable Test Suite.
Proposed change
Add the capability to validate XML documents against a schema before loading the document in the BaseX database. XML documents that are invalid are not loaded into the database and are ignored in the tests.
If a test object consists of multiple XML documents, parsing will use parallel threads to improve the performance.
The latest version of Xerces-J will be used.
Validation errors reported by the parser are reported as a sequence of text nodes in the XQuery variable $validationErrors that can be used in assertions.
The schema documents to use for validation are configured as parameters of an Executable Test Suite or Test Run Template (see #28). The parameters have the reserved name "schema" and the type "file-resource". Example:
ETF Improvement Proposal (EIP)
Background and Motivation:
The current BaseX test driver uses the BaseX validation module. This approach has limitations, for example, an older version of Xerces is used.
This approach also implies that validation is only executed as part of a regular assertion. In general, assertions are written assuming that the XML documents under test are valid. Invalid documents will often have side effects on unrelated assertions and can confuse the user. In general, only XML documents that are valid against a schema should be tested by an Executable Test Suite.
Proposed change
$validationErrors
that can be used in assertions.Alternatives
n/a
Funding
Yes
Additional information
Update https://github.com/etf-validator/etf-webapp/issues/181 in the process.