lib/xml-sitemap.rb in xml-sitemap-1.0.4 vs lib/xml-sitemap.rb in xml-sitemap-1.0.5
- old
+ new
@@ -50,11 +50,11 @@
# Render XML
def render
return '' if @items.size == 0
output = []
output << '<?xml version="1.0" encoding="UTF-8"?>'
- output << '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
+ output << '<urlset 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">'
@items.each do |item|
output << '<url>'
output << "<loc>http://#{@domain}#{item.path.to_s}</loc>"
output << "<lastmod>#{item.updated.utc.iso8601}</lastmod>"
output << "<changefreq>#{item.changefreq.to_s}</changefreq>"
@@ -93,6 +93,6 @@
end
output << '</sitemapindex>'
return output.join("\n")
end
end
-end
\ No newline at end of file
+end