Welcome to WebmasterWorld Guest from 54.161.110.186

Forum Moderators: httpwebwitch

Message Too Old, No Replies

XML Sitemap Validation Error

     
1:52 pm on Apr 21, 2011 (gmt 0)

5+ Year Member



Hi,

I am fairly new to XML so this may be something basic I have done wrong.

I am creating a sitemap in xml for a customer's site but I am having problems with a parser error where google webmaster central can't read the file.

I have validated the XML at Validome and I get this error message:
Error (1)
File name: sitemap.xml
Error: Prefix "image" for element "image:image" is not bound.
Error Postion: <image:image>

Here is an example section of my code: (I have replaced the domain witha generic name for privacy)
<?xml version="1.0" encoding="UTF-8"?>
<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 [sitemaps.org...]
<url>
<loc>http://www.example.com/index.html</loc>
<lastmod>2011-04-15T11:37:04+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.80</priority>
<image:image>
<image:loc>http://www.example.com/images/map.gif</image:loc>
<image:caption>Location Map</image:caption>
<image:title>Map</image:title>
</image:image>
</url>
</urlset>

Any help would be much appreciated

[edited by: httpwebwitch at 7:24 pm (utc) on Apr 25, 2011]
[edit reason] use example.com for examples, with exception for sitemaps.org [/edit]

7:30 pm on Apr 25, 2011 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



the sitemap schema does not expect any nodes named <image:image>

remove that section.

you also don't need to define the "xsi" namespace in the <urlset> element.

see: [sitemaps.org...]

there are examples there that you can compare
8:10 am on Apr 26, 2011 (gmt 0)

5+ Year Member



Thanks for your reply. Is there any way of referencing an image in a site map to include details of the images on the pages or is it not required?
Many thanks
1:02 pm on Apr 26, 2011 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



it's not required, nor allowed. You may be confusing a sitemap with an RSS feed, which does have image nodes and other metadata. Sitemaps are more sparse.

The sitemap lists URLs of pages - HTML/XML pages - that you want someone to visit and index. Bots that index images will do so when they download the page and grab all the <img> references in it.

Honestly I don't know what would happen if you put an image URL in a <loc>. Everything you need to know about sitemaps is explained at sitemaps.org; if it's not mentioned there it's not necessary and probably not recommended. Most webmasters will include images on pages, allow the pages to be indexed, and that works just dandy.
1:46 pm on Apr 26, 2011 (gmt 0)

5+ Year Member



I have been on Google Forum and asked about this. The Google sitemap allows images to be referenced in the sitemap.xml file but you have to include a namespace for the image tag to be recognised:

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

Link to google forum: [google.com...]
4:48 pm on Apr 26, 2011 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



that's neat!
thanks for coming back here to share your research.

with the added xmlns that Google suggests, the XML will validate.

I'd also hope that the sitemap.xml with the extra nodes doesn't confuse other bots (e.g. Bing).
4:05 pm on May 27, 2011 (gmt 0)

5+ Year Member



Just create a separate image sitemap containing the images and a separate for the normal XML sitemap
 

Featured Threads

Hot Threads This Week

Hot Threads This Month