Repository navigation
Improve schema validationย #49
Copy link
Copy link
Closed
Labels
EIP-approvedEIP approved by the Steering GroupEIP approved by the Steering GroupImpl.EIP has been implemented and is ready for the next release. Doc might be incomplete (temp. label)EIP has been implemented and is ready for the next release. Doc might be incomplete (temp. label)
Milestone
Description
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
- 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
$validationErrorsthat 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 Test Run Templatesย #28). The parameters have the reserved name "schema" and the type "file-resource". Example:
<parameter name="schema" required="true" static="true">
<defaultValue>DE/Ressourcen/schemas/adv/nas/6.0/aaa.xsd</defaultValue>
<type>file-resource</type>
</parameter>
- The schema documents can be stored locally with the test definitions to improve performance.
Alternatives
n/a
Funding
Yes
Additional information
Update https://github.com/etf-validator/etf-webapp/issues/181 in the process.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
EIP-approvedEIP approved by the Steering GroupEIP approved by the Steering GroupImpl.EIP has been implemented and is ready for the next release. Doc might be incomplete (temp. label)EIP has been implemented and is ready for the next release. Doc might be incomplete (temp. label)
Activity
[-]Schema validation cache[/-][+]Schema validation cache [DRAFT][/+][-]Schema validation cache [DRAFT][/-][+]Improve schema validation[/+]jonherrmann commentedon Aug 19, 2022
Implemented in Version 2.1.0