Permalink
Browse files

added more headers

  • Loading branch information...
1 parent 728d890 commit 112c8ed423d3ef05b02e8f73d031bcb34b550050 Tobias Bielohlawek committed Jan 14, 2011
Showing with 7 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +6 −1 lib/big_sitemap/builder.rb
View
@@ -1,2 +1,3 @@
+.rvmrc
._*
pkg
@@ -4,6 +4,11 @@
class BigSitemap
class Builder
MAX_URLS = 50000
+ HEADER_ATTRIBUTES = {
+ 'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9',
+ 'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
+ 'xsi:schemaLocation' => "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
+ }
def initialize(options)
@gzip = options.delete(:gzip)
@@ -69,7 +74,7 @@ def _open_writer(filename)
@gzip ? ::Zlib::GzipWriter.new(file) : file
end
- def _init_document( name = 'urlset', attrs = {'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9'})
+ def _init_document( name = 'urlset', attrs = HEADER_ATTRIBUTES)
@urls = 0
target!.print '<?xml version="1.0" encoding="UTF-8"?>'
_newline

0 comments on commit 112c8ed

Please sign in to comment.