function xmlsitemap_generate_index in XML sitemap 7.2
Same name and namespace in other branches
- 6.2 xmlsitemap.generate.inc \xmlsitemap_generate_index()
Generate the index sitemap.
Parameters
object $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 285 - Sitemap generation and rebuilding functions for the xmlsitemap module.
Code
function xmlsitemap_generate_index(stdClass $sitemap) {
try {
$writer = new XMLSitemapIndexWriter($sitemap);
$writer
->startDocument();
$writer
->generateXML();
$writer
->endDocument();
} catch (Exception $e) {
watchdog_exception('xmlsitemap', $e);
throw $e;
}
return $writer
->getSitemapElementCount();
}