docs: function (res) {
  
                          flen = files.length;
  
                          if (!res.messages) {
                              ++retryCount;
                              var netErrorMsg = msg.networkError + ' ' + retryCount.toString().error + ' ';
                              if (retryCount === options.maxTry) {
                                  counter++;
                                  if (counter !== flen) {
                                      netErrorMsg += msg.nextfile;
                                  } else {
                                      netErrorMsg += msg.eof;
                                  }
                                  retryCount = 0;
                              }
  
                              console.log(netErrorMsg);
                              validate(files);
                              return;
                          }
  
                          len = res.messages.length;
  
                          var setGreen = function () {
                              readSettings[files[counter]] = true;
                              grunt.log.ok(msg.ok.green);
  
                              reportFilename = options.remoteFiles ? dummyFile[counter] : files[counter];
                              addToReport(reportFilename, false);
                          };
  
                          if (len) {
                              var errorCount = 0,
                                  prop;
  
                              for (prop in res.messages) {
                                  res.messages[prop].unwrapLine = res.messages[prop].lastLine - wrapfile_line_start;
                              }
  
                              for (prop in res.messages) {
                                  var chkRelaxError;
                                  if (isRelaxError) {
                                      chkRelaxError = checkRelaxError(res.messages[prop].message);
                                  }
  
                                  if (!chkRelaxError) {
                                      errorCount = errorCount + 1;
  
                                      var lineNumber = ' Line no: ' + JSON.stringify(options.wrapfile ? res.messages[prop].unwrapLine : res.messages[prop].lastLine);
                                      if (typeof(prompt) !== 'undefined') {
                                          lineNumber = lineNumber.prompt;
                                      }
  
                                      console.log(errorCount + '=> '.warn + JSON.stringify(res.messages[prop].message).help + lineNumber );
                                  }
  
                              }
  
                              if (errorCount !== 0) {
                                  console.log('No of errors: '.error + errorCount);
                              }
  
                              readSettings[files[counter]] = false;
                              reportFilename = options.remoteFiles ? dummyFile[counter] : files[counter];
                              addToReport(reportFilename, res.messages);
  
                              if (options.stoponerror) {
                                  done();
                                  return;
                              }
  
                              if (isRelaxError && errorCount === 0) {
                                  setGreen();
                              }
  
                          } else {
  
                              setGreen();
  
                          }
  
                          grunt.file.write(options.path, JSON.stringify(readSettings));
                          // depending on the output type, res will either be a json object or a html string
                          counter++;
  
                          if (counter === flen) {
                              if (options.reportpath) {
                                  grunt.file.write(options.reportpath, JSON.stringify(reportArry));
                                  console.log('Validation report generated: '.green + options.reportpath);
                              }
                              if (options.failHard) {
                                  var validationErrCount = reportArry.reduce(function (sum, report) {
                                      return sum + report.error.length;
                                  }, 0);
                                  if (validationErrCount > 0) {
                                      grunt.fail.warn(validationErrCount + ' total unignored HTML validation error' + grunt.util.pluralize(validationErrCount, '/s') + '.');
                                  }
                              }
                              done();
                              if (!options.remoteFiles) {
                                  return;
                              }
                          }
  
                          if (options.remoteFiles) {
                              if (counter === flen) {
                                  return;
                              }
  
                              rval(dummyFile[counter], function () {
                                  validate(files);
                              });
  
                          } else {
                              validate(files);
                          }
                      }