What is wrong with my sitemap.xml?

I used Googles Sitemap creator to make my sitemap.xml file, and now the sitemap tool keeps telling me there are 2 errors:

Line:2 Invalid XML attribute

The XML attribute of this tag was not recognized. Please fix it and resubmit.

Problem detected on: urlset

Attribute: schemaLocation

Line: 2 Incorrect namespace

Your Sitemap or Sitemap index file doesn't properly declare the namespace.

Problem detected on: urlset

Now, like I said, "googles" tool made the thing.. why would there be errors??

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    Without seeing your XML, I can't diagnose the problem with great certainty. Seems the complaint is about the xmlns (XML namespace attribute) for the schema's location of your urlset tag. Here's a properly declared sample (leading dots just keep indentation, since Y!A deletes leading whitespace - they are not valid):

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

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

    ....<url>

    ........<loc> http://home.comcast.net/~richarduie/index.html </loc>

    ........<lastmod> 2008-06-05 </lastmod>

    ........<changefreq> monthly </changefreq>

    ........<priority> 0.9 </priority>

    ....</url>

    </urlset>

    Why Google's tools would incorrectly specify the value, I have no idea. I compose my own.

    Added: the xmlns attribute value that got truncated is

    http:// www. sitemaps. org/ schemas/ sitemap/ 0.9

    without the spaces.

    • Login to reply the answers
Still have questions? Get your answers by asking now.