diff --git a/kadmos/graph/graph_kadmos.py b/kadmos/graph/graph_kadmos.py index dbcbe5ef51a538d0972ec33d5ced6204ce3c92fe..5a4b5b042f50544359eeba07520a313cd5c7e3d1 100644 --- a/kadmos/graph/graph_kadmos.py +++ b/kadmos/graph/graph_kadmos.py @@ -5339,9 +5339,11 @@ def _perform_check_list(io_list, check_list, keep_running=False): _check_leafs(io_list, leafs, keep_running=keep_running) # Check file against XSD schema - if xsd_check: + if xsd_check and io_list: + logger.info('Checking for invalidities w.r.t. schema...') schema_path = _get_data_schema(os.path.split(io_list[0][0])[0]) - _validate_file_against_schema(io_list[0][0], schema_path, keep_running=keep_running) + for item in io_list: + _validate_file_against_schema(item[0], schema_path, keep_running=keep_running) return @@ -5639,7 +5641,7 @@ def _get_data_schema(kb_dir): raise IOError('No XML Schemas (.xsd files) found in the knowledge base ({}). ' 'One .xsd file is required per knowledge base.'.format(os.path.split(kb_dir)[1])) else: - logger.info("XML Schema '{}' found.".format(data_schema)) + logger.info(" XML Schema '{}' found.".format(data_schema)) return os.path.join(kb_dir, data_schema) @@ -5651,7 +5653,6 @@ def _validate_file_against_schema(file_path, schema_path, keep_running=False): :rtype: Error """ - logger.info('Checking for invalidities w.r.t. schema') # Parse the XML file tree = etree.parse(file_path) @@ -5662,10 +5663,10 @@ def _validate_file_against_schema(file_path, schema_path, keep_running=False): # Perform file validation validated = xmlschema.validate(tree) if validated: - logger.info('The XML file {} has been validated against the schema {}.'.format(os.path.split(file_path)[1], + logger.info(' The XML file {} has been validated against the schema {}.'.format(os.path.split(file_path)[1], os.path.split(schema_path)[1])) else: - logger.debug('Schema validation errors:') + logger.debug(' Schema validation errors:') for error in xmlschema.error_log: logger.debug('ERROR ON LINE {} in file {}: {}'.format(error.line, os.path.split(file_path)[1], error.message.encode("utf-8")))