sosedoff / xml-sitemap

Easy XML sitemap generation for Ruby/Rails/Merb/Sinatra applications
MIT License
57 stars 19 forks source link

Sitemap Index root & attributes #8

Closed danhealy closed 13 years ago

danhealy commented 13 years ago

From http://www.sitemaps.org/protocol.php , it says sitemap index files should be generated like this:

<sitemapindex 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/siteindex.xsd"
         xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

   <sitemap>

      ...

   </sitemap>

</sitemapindex>

Currently, we are generating:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
         <sitemap>

            ...

         </sitemap>

</urlset>

The difference being "urlset" vs "sitemapindex" and the namespace and schema attributes. Do you know if the current method is valid? Should we modify the output to match the protocol anyway?

Thanks.

sosedoff commented 13 years ago

Oh shit, good catch.

I havent used the indexes for a while, and the typo was introduced here: https://github.com/sosedoff/xml-sitemap/commit/f36f9015b15b37595a595f59cd7663d955c57633#diff-0 after switch to builder

Also, would need to put additional meta to xml. You want to work on this?

sosedoff commented 13 years ago

Merged, thanks!