Project

Profile

Help

Bug #4845

closed

PySchemaValidator.validation_report always None, and clears all errors

Added by Craeg Strong over 3 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
Normal
Category:
Python
Start date:
2020-11-29
Due date:
% Done:

0%

Estimated time:
Found in version:
1.2.1
Fixed in version:
Platforms:

Description

It appears that accessing the validation report clears errors and always returns None

Given that schema_filepath points to a valid XSD, and test_filepath points to an XML with exactly one validation error against that XSD:

saxon_proc = saxonc.PySaxonProcessor(license=True)
validator = saxon_proc.new_schema_validator()
assert validator is not None
validator.register_schema(xsd_file=str(schema_filepath))
# print(f'validating {test_filepath}  with {schema_filepath}')
validator.validate(file_name=str(test_filepath))
print(v.exception_count())
print(v.exception_occurred())
print(v.validation_report)
print(v.exception_count())
print(v.exception_occurred())

Returns this:

1
True
None
0
False

Please register to edit this issue

Also available in: Atom PDF