2008-11-20 33 views
8

对于以下标题,我在我的所有站点地图上都收到了相同的两个错误。这很让人困惑,因为如果Google无法读取我的站点地图,那他们怎么能说每个URL具有相同的优先级?在XML声明之后,标题计为第2行。谷歌声称只有大约2%的网址来自地图。请帮忙。如何验证兼容的XML站点地图?

更新:我认为问题是我不知道如何验证模式。怎么做?

<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... 

UPDATE:请耐心等待,第一次验证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> 
+0

你怎么知道错误是在头后,我的这个问题?你可以请张贴一些从网站地图文件? – Slavo 2008-11-20 12:09:07

回答

8

您确认您对XML架构这里给出:http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd

如果有,结果是什么?

如果没有,您的站点地图的网址是什么?

如果你不知道如何验证对模式的XML,使用http://www.xmlvalidation.com/

站点地图的XML有粘贴,点击“验证对外部XML模式”,然后点击Validate-后粘贴架构按钮。

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

编辑:错误是schemaLocation中缺少namesapce-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"> 
+0

我不知道该怎么做.. – Jesse 2008-11-20 12:12:05

4

罢工上述。看着谷歌的网站,他们的网站地图标题似乎比你的要长一些。

这是此页上: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"> 
+0

我认为问题在于我不知道如何根据模式进行验证。 – Jesse 2008-11-20 12:22:16

0

我也失去了一些东西在这句法

的xmlns:XSI = “http://www.w3.org/2001/XMLSchema-instance”
XSI :schemaLocation =“http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xs”>

你有什么遗漏了这种语法?

只是字母“d”在URL扩展(http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xs

年底解决加字母“d”