lib/input-generators/sitemap-index.js
function processSitemap (options, document, callback) {
  smLib.parse(options, document, function (err) {
    var sitemapIndexOpts = options.__sitemapIndex;
    var outputPath = base.outputFile(sitemapIndexOpts, options.source);

    if (!err && sitemapIndexOpts.sitemapOutputDir) {
      prepareWrite(outputPath, function (err) {
        if (!err) {
          fs.writeFile(outputPath, document, callback);
        } else {
          callback(common.prependMsgToErr(err, outputPath, true));
        }
      });
    } else {
      callback(err);
    }
  });
}
function processSitemap (options, document, callback) {
  smLib.parse(options, document, function (err) {
    var sitemapIndexOpts = options.__sitemapIndex;
    var outputPath = base.outputFile(sitemapIndexOpts, options.source);

    if (!err && sitemapIndexOpts.sitemapOutputDir) {
      prepareWrite(outputPath, function (err) {
        if (!err) {
          fs.writeFile(outputPath, document, callback);
        } else {
          callback(common.prependMsgToErr(err, outputPath, true));
        }
      });
    } else {
      callback(err);
    }
  });
}
function processSitemap ( options , document , callback ) { smLib . parse ( options , document , function ( err ) { var sitemapIndexOpts = options . __sitemapIndex ; var outputPath = base . outputFile ( sitemapIndexOpts , options . source ) ; if ( ! err && sitemapIndexOpts . sitemapOutputDir ) { prepareWrite ( outputPath , function ( err ) { if ( ! err ) { fs . writeFile ( outputPath , document , callback ) ; } else { callback ( common . prependMsgToErr ( err , outputPath , true ) ) ; } } ) ; } else { callback ( err ) ; } } ) ; }
Parse a sitemap, generate input, and optionally update the local file
for sitemapPolicy purposes.
This writes the sitemap files out EVEN IF sitemapPolicy is false.
The thinking is that it's better/cheaper to do this b/c if sitemapPolicy is
enabled later, then there is something to compare against, for more savings.

@param {Object} options - Sitemap options.
@param {Object} options.__sitemapIndex - Sitemap Index options.
@param {String} document - xml document string.
@param {Function} callback - A completion callback.
Parse a sitemap generate input and optionally update the local file for sitemapPolicy purposes . This writes the sitemap files out EVEN IF sitemapPolicy is false . The thinking is that it s better / cheaper to do this b / c if sitemapPolicy is enabled later then there is something to compare against for more savings .