diff --git a/knora/dsplib/utils/xml_upload.py b/knora/dsplib/utils/xml_upload.py index 92f72592d..5ae0f947e 100644 --- a/knora/dsplib/utils/xml_upload.py +++ b/knora/dsplib/utils/xml_upload.py @@ -580,12 +580,12 @@ def validate_xml_against_schema(input_file: str, schema_file: str) -> bool: xmlschema = etree.XMLSchema(etree.parse(schema_file)) doc = etree.parse(input_file) - is_valid = False - if xmlschema.validate(doc): - is_valid = True - - return is_valid + return True + else: + print("The input data file cannot be uploaded due to the following validation error(s):") + for error in xmlschema.error_log: + print(f" Line {error.line}: {error.message}") def convert_ark_v0_to_resource_iri(ark: str) -> str: