code: def check_schema_coverage(doc, schema):
      '''
      FORWARD CHECK OF DOCUMENT
      
      This routine looks at each element in the doc, and makes sure there
      is a matching 'name' in the schema at that level.
      '''
      error_list = []
      to_delete = []
      for entry in doc.list_tuples():
          (name, value, index, seq) = entry
          temp_schema = schema_match_up(doc, schema)
          if not name in temp_schema.list_values("name"):
              error_list.append( ("[error]", "doc", seq, "a name of '{}' not found in schema".format(name)) )
              to_delete.append(seq)
          else:
              # check subs
              el = check_schema_coverage(doc[name, value, index], temp_schema["name", name])
              error_list.extend(el)
      for seq in to_delete:
          doc.seq_delete(seq)
      return error_lisf check_schema_coverage(doc, schema):
      '''
      FORWARD CHECK OF DOCUMENT
      
      This routine looks at each element in the doc, and makes sure there
      is a matching 'name' in the schema at that level.
      '''
      error_list = []
      to_delete = []
      for entry in doc.list_tuples():
          (name, value, index, seq) = entry
          temp_schema = schema_match_up(doc, schema)
          if not name in temp_schema.list_values("name"):
              error_list.append( ("[error]", "doc", seq, "a name of '{}' not found in schema".format(name)) )
              to_delete.append(seq)
          else:
              # check subs
              el = check_schema_coverage(doc[name, value, index], temp_schema["name", name])
              error_list.extend(el)
      for seq in to_delete:
          doc.seq_delete(seq)
      return error_list
docs: FORWARD CHECK OF DOCUMENT
      
      This routine looks at each element in the doc, and makes sure there
      is a matching 'name' in the schema at that level.