You are here

function xmlsitemap_generate_index in XML sitemap 6.2

Same name and namespace in other branches
  1. 7.2 xmlsitemap.generate.inc \xmlsitemap_generate_index()

Generate the index sitemap.

Parameters

$sitemap: An unserialized data array for an XML sitemap.

1 call to xmlsitemap_generate_index()
xmlsitemap_regenerate_batch_generate_index in ./xmlsitemap.generate.inc
Batch callback; generate the index page of a sitemap.

File

./xmlsitemap.generate.inc, line 262
Sitemap generation and rebuilding functions for the xmlsitemap module.

Code

function xmlsitemap_generate_index(stdClass $sitemap) {
  xmlsitemap_load_all_includes();
  try {
    $writer = new XMLSitemapIndexWriter($sitemap);
    $writer
      ->startDocument();
    $writer
      ->generateXML();
    $writer
      ->endDocument();
  } catch (Exception $e) {
    watchdog_exception('xmlsitemap', $e);
    throw $e;
    return FALSE;
  }
  return $writer
    ->getSitemapElementCount();
}