9

对于以下标题,我在所有站点地图上都遇到了相同的两个错误。这很令人困惑,因为如果 Google 无法读取我的站点地图,那么他们怎么能说每个 URL 具有相同的优先级?在 XML 声明之后,标头算作第 2 行。谷歌声称只索引了地图中大约 2% 的 URL。请帮忙。

更新:我认为问题在于我不知道如何针对模式进行验证。怎么做?

<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/sitemap.xsd">

==Parsing error
We were unable to read your Sitemap. It may contain an entry we are 
unable to recognize. Please validate your Sitemap before resubmitting.

==Notice
All the URLs in your Sitemap have the same priority...

更新:请耐心等待,第一次验证 XML。我不明白错误。

Errors in the XML document:
    4:  80  SchemaLocation: schemaLocation value = 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd' must have even number of URI's.
    4:  80  cvc-elt.1: Cannot find the declaration of element 'urlset'.

XML document:
1   <?xml version="1.0" encoding="UTF-8"?>
2   <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4     xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
5     <url>
6       <loc>http://nutrograph.com/1-butter-salted</loc>
7       <changefreq>monthly</changefreq>
8       <priority>0.8</priority>
9     </url>
10    <url>
11      <loc>http://nutrograph.com/2-butter-whipped-with-salt</loc>
12      <changefreq>monthly</changefreq>
13      <priority>0.8</priority>
14    </url>
15  </urlset>
4

4 回答 4

8

您是否根据此处给出的架构验证了您的 XML:http ://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd

如果是,结果如何?

如果不是,您的站点地图的 URL 是什么?

如果您不知道如何根据架构验证 XML,请使用http://www.xmlvalidation.com/

将站点地图 XML 粘贴到那里,单击“根据外部 XML 模式验证”并在单击“验证”按钮后粘贴模式。

这将告诉您 XML 有什么问题。如果您不知道如何解释结果,请相应地修改您的原始问题。

编辑:错误是 schemaLocation 中缺少命名空间 URL。第一个标签必须如下所示:

<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">
于 2008-11-20T12:11:04.337 回答
5

打击以上。查看 Google 的站点,他们的站点地图标题似乎比您的要长一点。

它在这个页面上:https ://www.google.com/webmasters/tools/docs/en/protocol.html

<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">
于 2008-11-20T12:13:20.793 回答
0

注意 schemaLocation 有 2 个 URI...(必须有偶数个 URI)

它应该如下所示:**

xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd "

**

于 2009-04-16T20:19:42.160 回答
0

我在这种语法中也遗漏了一些东西

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xs">

你错过了这个语法吗?!

只是在 url 扩展名末尾的字母“d”(http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xs

添加字母“d”后解决我的这个问题

于 2014-12-05T14:05:10.427 回答