Sitemap index
What goes wrong in Sitemap index
The 2 errors this corpus records against Sitemap index documents, keyed by the message your parser printed. Nothing here is written for this page — each error declares the formats it bites, and this is that declaration read the other way round.
Start with the message you were given
Every entry below states the message our validator emits, verbatim, and a test asserts it still does. If you are holding a broken document rather than a question, Sitemap validator will tell you which of these you have.Parse errors · 2
These stop the document being read at all. Nothing downstream sees a file with one of them, because it is not XML.
- Premature end of data in tag
Premature end of data in tag urlset line 1 (line 2)The document ended while one or more elements were still open — almost always truncation, not an authoring mistake. - Unescaped ampersand (EntityRef: expecting ';')
EntityRef: expecting ';' (line 2)A bare & appeared in content. XML reads it as the start of an entity reference and expects a name and a semicolon.
Where these land
The elements of a Sitemap index document, each with the rules it has to follow and a broken and a fixed example that were run.
- <sitemapindex>The root element of a sitemap index: a list of sitemaps rather than a list of URLs, in the same namespace as an ordinary sitemap.
- <sitemap>One child sitemap in an index: a required <loc> pointing at the sitemap file, and an optional <lastmod> for it.
- <loc>The URL of a child sitemap. Same element name as in a sitemap, different meaning: it points at a file, not at a page.
- <lastmod>When a child sitemap last changed — the element that lets a crawler skip a file it has already seen.
Back to Sitemap index — root element, namespaces, constraints and a worked example.
Get started
Bring order to the XML your team can't afford to ignore.
Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.