Google sitemap namespace confusion

Here the structure of my sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>somefile.xml</loc>
    </sitemap>
</sitemapindex>

somefile.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
  <loc>[some url]</loc>
  <link rel="alternate" hreflang="en" href="[some url]" />
  <link rel="alternate" hreflang="en" href="[some url]?lang=en" />
  <link rel="alternate" hreflang="fr" href="[some url]?lang=fr" />
  <priority>1.00</priority>
</url>

Here is Google's error message:

Your Sitemap or Sitemap index file doesn't properly declare the namespace. Expected: http://www.sitemaps.org/schemas/sitemap/0.9 Found: http://www.w3.org/1999/xhtml Tag: urlset

I guess I'm missing something, information on the Internet are confusing. What's is the right syntax? Thank you if you can help.


Problem solved by replace add the xhtml namespace to all the 'link' tags.

Replacing

<link

with

<xhtml:link 

您应该将xmlns="http://www.w3.org/1999/xhtml"添加到您的网址中:

<link rel="alternate" hreflang="en" href="[some url]" xmlns="http://www.w3.org/1999/xhtml" />
链接地址: http://www.djcxy.com/p/65712.html

上一篇: 发布xml模式的标准方式

下一篇: Google站点地图命名空间混乱