Project

Profile

Help

Bug #4845

Updated by O'Neil Delpratt over 3 years ago

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: 

 ~~~ python 
 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 
 ~~~

Back