Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve schema validation #49

Closed
jonherrmann opened this issue Oct 2, 2018 · 1 comment
Closed

Improve schema validation #49

jonherrmann opened this issue Oct 2, 2018 · 1 comment
Assignees
Labels
EIP-approved EIP approved by the Steering Group Impl. EIP has been implemented and is ready for the next release. Doc might be incomplete (temp. label)
Milestone

Comments

@jonherrmann
Copy link
Contributor

jonherrmann commented Oct 2, 2018

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 $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 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 etf-validator/etf-webapp#181 in the process.

@jonherrmann jonherrmann added the EIP-draft Announcement. Will not be discussed further as long as the necessary information is available. label Oct 2, 2018
@jonherrmann jonherrmann self-assigned this Oct 2, 2018
@jonherrmann jonherrmann changed the title Schema validation cache Schema validation cache [DRAFT] Jan 14, 2019
@cportele cportele assigned cportele and unassigned jonherrmann Apr 20, 2020
@cportele cportele added EIP Improvement Proposal. Put up for discussion. and removed EIP-draft Announcement. Will not be discussed further as long as the necessary information is available. labels Apr 24, 2020
@cportele cportele changed the title Schema validation cache [DRAFT] Improve schema validation Apr 24, 2020
@cportele cportele added EIP-approved EIP approved by the Steering Group and removed EIP Improvement Proposal. Put up for discussion. labels May 7, 2020
@jonherrmann jonherrmann added the Impl. EIP has been implemented and is ready for the next release. Doc might be incomplete (temp. label) label May 23, 2022
@jonherrmann
Copy link
Contributor Author

Implemented in Version 2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EIP-approved EIP approved by the Steering Group Impl. EIP has been implemented and is ready for the next release. Doc might be incomplete (temp. label)
Projects
None yet
Development

No branches or pull requests

2 participants