code: def parse_table_definition_file(file):
      '''
      Read an parse the XML of a table-definition file.
      @return: an ElementTree object for the table definition
      '''
      logging.info("Reading table definition from '%s'...", file)
      if not os.path.isfile(file):
          logging.error("File '%s' does not exist.", file)
          exit(1)
  
      try:
          tableGenFile = ElementTree.ElementTree().parse(file)
      except IOError as e:
          logging.error('Could not read result file %s: %s', file, e)
          exit(1)
      except ElementTree.ParseError as e:
          logging.error('Table file %s is invalid: %s', file, e)
          exit(1)
      if 'table' != tableGenFile.tag:
          logging.error("Table file %s is invalid: It's root element is not named 'table'.", file)
          exit(1)
      return tableGenFilf parse_table_definition_file(file):
      '''
      Read an parse the XML of a table-definition file.
      @return: an ElementTree object for the table definition
      '''
      logging.info("Reading table definition from '%s'...", file)
      if not os.path.isfile(file):
          logging.error("File '%s' does not exist.", file)
          exit(1)
  
      try:
          tableGenFile = ElementTree.ElementTree().parse(file)
      except IOError as e:
          logging.error('Could not read result file %s: %s', file, e)
          exit(1)
      except ElementTree.ParseError as e:
          logging.error('Table file %s is invalid: %s', file, e)
          exit(1)
      if 'table' != tableGenFile.tag:
          logging.error("Table file %s is invalid: It's root element is not named 'table'.", file)
          exit(1)
      return tableGenFile
docs: Read an parse the XML of a table-definition file.
      @return: an ElementTree object for the table definition