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

Treat all fatal XR schematron rules as errors, not as warnings. #595

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

mkilian
Copy link
Contributor

@mkilian mkilian commented Nov 29, 2024

In org.mustangproject.validator.XMLValidator.validateSchematron(), the severity has to be determined for every node of the validation result. Otherwise, all schematron assertions tagged as "fatal" will be treated as warnings after the first warning.

In org.mustangproject.validator.XMLValidator.validateSchematron(),
the severity has to be determined for every node of the validation
result.  Otherwise, all schematron assertions tagged as "fatal"
will be treated as warnings after the first warning.
@mkilian
Copy link
Contributor Author

mkilian commented Nov 29, 2024

Some more details:

In commit aeb4918, the severity
is only properly initialized (to ESeverity.error), which, after the
first failed assertion tagged as "warning" found in the XR schematron
validation result, causes all further failed assertions to be treated
as warnings, regardless wether they are tagged as "warning" or
"fatal."

For example, validator/src/test/resources/invalidXRV30.xml is missing
the buyer reference (BT-10), but the related assertion [BR-DE-15]
is counted as a warning only.

This change moves the determination of the severity to apply into
the loop over the failed assertions of the schematron validation
and also changes the corresponding test case accordingly.

@jstaerk jstaerk merged commit 6400c84 into ZUGFeRD:master Dec 3, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants