Google Sitemap问题

时间:2010-09-25 18:14:01

标签: sitemap

我向Google提交了一个站点地图,我收到了此错误消息。

命名空间不正确 您的Sitemap或Sitemap索引文件未正确声明命名空间。预期:http://www.google.com/schemas/sitemap-image/1.1找到:http://www.sitemaps.org/schemas/sitemap-image/1.1

我认为sitemaps.org没问题。我从谷歌的例子中得到了它:

Google's sitemap example

我做错了什么?有什么想法吗?

3 个答案:

答案 0 :(得分:2)

您是否尝试过更换

http://www.sitemaps.org/schemas/sitemap-image/1.1

http://www.google.com/schemas/sitemap-image/1.1

因为这似乎有问题?

如果您有帮助,可以在此处发布您的站点地图吗?只包含几个网址标记。

更新:此页面可能有用:http://www.sitemaps.org/protocol.php。这是我在写第一个站点地图时开始的地方。

另一个想法:如果你没有直接链接到图片或视频但只链接到html页面或php页面,你可能会删除

xmlns:image="http://www.sitemaps.org/schemas/sitemap-image/1.1"

xmlns:video="http://www.sitemaps.org/schemas/sitemap-video/1.1

我没有在我的站点地图中使用该代码,它可以正常工作。

答案 1 :(得分:0)

你好 实际上,解决方案是替换此:

<sitemapindex xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9/ https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">

与此:

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

它可以按预期工作,Google sitemap可以读取文件。

谢谢

答案 2 :(得分:-1)

XML命名空间用于在XML文档中提供唯一命名的元素和属性。

使用名称前缀可以轻松避免XML中的名称冲突。

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/"> <html> <body>   <h2>My CD Collection</h2>  
<table border="1">
    <tr>
      <th style="text-align:left">Title</th>
      <th style="text-align:left">Artist</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
      <td><xsl:value-of select="title"/></td>
      <td><xsl:value-of select="artist"/></td>
    </tr>
    </xsl:for-each>   </table> </body> </html> </xsl:template>

</xsl:stylesheet>