You are here

public function XMLSitemapWriter::getRootAttributes in XML sitemap 7.2

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

Return an array of attributes for the root element of the XML.

1 call to XMLSitemapWriter::getRootAttributes()
XMLSitemapWriter::startElement in ./xmlsitemap.xmlsitemap.inc
Start Element.
1 method overrides XMLSitemapWriter::getRootAttributes()
XMLSitemapIndexWriter::getRootAttributes in ./xmlsitemap.xmlsitemap.inc
Get Root Attributes.

File

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

Class

XMLSitemapWriter
Extended class for writing XML sitemap files.

Code

public function getRootAttributes() {
  $attributes['xmlns'] = 'http://www.sitemaps.org/schemas/sitemap/0.9';
  if (variable_get('xmlsitemap_developer_mode', 0)) {
    $attributes['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance';
    $attributes['xsi:schemaLocation'] = 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd';
  }
  drupal_alter('xmlsitemap_root_attributes', $attributes, $this->sitemap);
  return $attributes;
}