homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

XML Sitemap Validation Error

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


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"?>
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 [sitemaps.org...]
<image:caption>Location Map</image:caption>

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)

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)

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)

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)

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:


Link to google forum: [google.com...]


 4:48 pm on Apr 26, 2011 (gmt 0)

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)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved