Google sitemap.xml Validation

There are several ways to validate a Google sitemap.xml file. Because I have MSXML 4.0 installed, I finally decided to try validating my file as described in an older O'Reilly xml.com article, An Overview of MSXML 4.0 by Steven Livingstone, June 04, 2002

My sitemap file validated easily enough as far as being well-formed, but I also wanted to validate it against Google's schema file. After modifying the sample5.htm file to use my sitemap.xml file, IE gave this error

Error: file: ….. sitemap.xsd#/schema
[1]/element[position() = 6 and @name = 'priority']/simpleType
[1]/restriction
[1]It is an error for the value specified for minInclusive to be greater than the value specified for maxInclusive for the same datatype.

Checking Google's sitemap.xsd file shows this as the trouble area

<xsd:restriction base="xsd:decimal">
<xsd:minInclusive value="0.0"/>
<xsd:maxInclusive value="1.0"/>
</xsd:restriction>

So MSXML 4.0 considers the decimal 0.0 as being greater than the decimal 1.0 ???

I downloaded the schema file and changed the datatype to float, changed the script in the HTML file to use my modified local copy of the schema file and tried again. Success!

Of course a float is not a decimal, so this technique does introduce the possibilty of error, but I think it's better than not validating my sitemap file at all and hoping it's OK.

Technorati Tags: , ,

Post a Comment

Your email is never shared. Required fields are marked *

*
*