You are here

function xmlsitemap_generate_page in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap.generate.inc \xmlsitemap_generate_page()

Generate one page (chunk) of the sitemap.

Parameters

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

string $page: An integer of the specific page of the sitemap to generate.

1 call to xmlsitemap_generate_page()
xmlsitemap_regenerate_batch_generate in ./xmlsitemap.generate.inc
Batch callback; generate all pages of a sitemap.

File

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

Code

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