开发者

Google Sitemap Problem

I submitted a sitemap to Google and I got this error.

Incorrect namespace Your Sitemap or Sitemap index file doesn't properly declare the namespace. Expected: http://www.google.com/schemas/sitemap-image/1.1 Found: http://www.sitemaps.org/schemas/sitemap-image/1.1

I thought that 开发者_JAVA百科sitemaps.org was okay. I took it from Google's example:

Google's sitemap example

What am I doing wrong? Any ideas?


Have you tried replacing

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

with

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

since that seem to be problem?

If you have and that didn't help, can you post your sitemap here? Include just a few url tags.

Update: This page may be of use: http://www.sitemaps.org/protocol.php. It's where I started when I wrote my first sitemap.

Another thought: In case you don't link directly to images or videos but only to html pages or php pages, you probably can remove

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

and

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

I'm not using that code in my sitemap, and it works as it should.


Hello, Actually the solution was replacing this:

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

With this:

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

And it works as expected and Google sitemap can be able to read the file.

Thank you


XML namespaces are used for providing uniquely named elements and attributes in an XML document.

Name conflicts in XML can easily be avoided using a name prefix.

<?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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜