You are here

public function XMLSitemapWriter::startDocument in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap.xmlsitemap.inc \XMLSitemapWriter::startDocument()

Start Document.

File

./xmlsitemap.xmlsitemap.inc, line 82
XML sitemap integration functions for xmlsitemap.module.

Class

XMLSitemapWriter
Extended class for writing XML sitemap files.

Code

public function startDocument($version = '1.0', $encoding = 'UTF-8', $standalone = NULL) {
  $this
    ->setIndent(FALSE);
  $result = parent::startDocument($version, $encoding);
  if (!$result) {
    throw new XMLSitemapGenerationException(t('Unknown error occurred while writing to file @file.', array(
      '@file' => $this->uri,
    )));
  }
  if (variable_get('xmlsitemap_xsl', 1)) {
    $this
      ->writeXSL();
  }
  $this
    ->startElement($this->rootElement, TRUE);
  return $result;
}