docs: def process(self, ymlfile):
          """Cleans out all document tags from the YAML file to make it
          JSON-friendly to work with the JSON Schema.
          """
          output = ""
  
          try:
              # Need a list of line numbers where the documents resides
              # Used for finding/displaying errors
              self.doclines = []
              linenum = None
              with open(ymlfile, 'r') as txt:
                  for linenum, line in enumerate(txt):
                      # Pattern to match document start lines
                      doc_pattern = re.compile('(---) (![a-z]+)(.*$)', flags=re.I)
  
                      # Pattern to match sequence start lines
                      seq_pattern = re.compile('(\s*)(-+) !([a-z]+)(.*$)', flags=re.I)
  
                      # If we find a document, remove the tag
                      if doc_pattern.match(line):
                          line = doc_pattern.sub(r"---", line).lower()
                          self.doclines.append(linenum)
                      elif seq_pattern.match(line):
                          # Replace the sequence start with key string
                          line = seq_pattern.sub(r"\1\2 \3: line " + str(linenum), line).lower()
  
                      output = output + line
  
              if linenum is None:
                  msg = "Empty YAML file: " + ymlfile
                  raise util.YAMLError(msg)
              else:
                  # Append one more document to docline for the end
                  self.doclines.append(linenum+1)
  
              return output
  
          except IOError, e:
              msg = "Could not process YAML file '" + ymlfile + "': '" + str(e) + "'"
              raise IOError(msg)