You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
crawl/sitemap-valid: a sitemap with a namespace-prefixed root (ns0:urlset) is reported as Unknown sitemap format #759
parseSitemap (packages/crawler/src/sitemaps.ts) looks for a root element named exactly urlset or sitemapindex. A sitemap that binds the sitemap namespace to a prefix, such as <ns0:urlset xmlns:ns0="http://www.sitemaps.org/schemas/sitemap/0.9"><ns0:url><ns0:loc>..., is reported by crawl/sitemap-valid as Unknown sitemap format, and none of its URLs are read. Python's ElementTree writes this form by default when a namespace is registered without an empty prefix, and it is valid XML in the sitemap namespace. The body check in decodeSitemapBody already accepts any prefix on the root, so the file is treated as a sitemap and then fails to parse as one.
A urlset whose elements carry a prefix bound to http://www.sitemaps.org/schemas/sitemap/0.9 parses with no errors, and its URLs, lastmods and priorities are read as for the unprefixed form.
The same holds for a prefixed sitemap index and its child sitemaps.
A root in another namespace, whatever its prefix, is still Unknown sitemap format.
Parser tests cover the prefixed urlset, the prefixed index and the foreign-namespace root.
Note from the review of #792: criterion 3 ("a root in another namespace, whatever its prefix, is still Unknown sitemap format") is implemented for PREFIXED roots only. An unprefixed root with a wrong or missing default namespace (<urlset xmlns="urn:other">, or no xmlns at all) is still read as a sitemap, as before. Many real sitemaps declare a wrong or missing namespace, so tightening that would drop them.
Activity
fix(crawler): read a sitemap whose root is prefixed with the sitemap …
fix(crawler): guard the prefix strip against __proto__, repeats and a…
nc9 commentedon Oct 15, 2026
Note from the review of #792: criterion 3 ("a root in another namespace, whatever its prefix, is still Unknown sitemap format") is implemented for PREFIXED roots only. An unprefixed root with a wrong or missing default namespace (
<urlset xmlns="urn:other">, or no xmlns at all) is still read as a sitemap, as before. Many real sitemaps declare a wrong or missing namespace, so tightening that would drop them.fix(crawler): read a sitemap whose root is prefixed with the sitemap …
fix(crawler): guard the prefix strip against __proto__, repeats and a…
fix(crawler): read sitemaps whose root element carries a namespace pr…