This [https://stackoverflow.com/a/43502548/5540654 response] in
StackOverflow contains the correct fix.
The error in the `sitemap.xml` template error is simply a missing slash
for `xmlns:xhtml="http://www.w3.org/1999/xhtml/"`
[https://github.com/django/django/blob/4ca508a68916dd43da45fd6e8b9004824a62d9c8/django/contrib/sitemaps/templates/sitemap.xml#L2
in line 2].
--
Ticket URL: <https://code.djangoproject.com/ticket/33117>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Carlton Gibson, Florian Demmer (added)
Comment:
"http://www.w3.org/1999/xhtml/" without a trailing slash should be
completely valid. Florian, Can you take a look?
--
Ticket URL: <https://code.djangoproject.com/ticket/33117#comment:1>
Comment (by Florian Demmer):
What validator was used to produce this error?
Not only is the namespace name "http://www.w3.org/1999/xhtml" valid, the
name "http://www.w3.org/1999/xhtml/" (with trailing slash) would be a
different namespace.
As specified in [https://www.w3.org/TR/REC-xml-names/#NSNameComparison 2.3
Comparing URI References]:
URI references identifying namespaces are compared when determining
whether a name belongs to a given namespace, and whether two names belong
to the same namespace. [Definition: The two URIs are treated as strings,
and they are identical if and only if the strings are identical, that is,
if they are the same sequence of characters. ] The comparison is case-
sensitive, and no %-escaping is done or undone.
and [https://www.w3.org/TR/REC-xml-names/#ns-decl 3 Declaring Namespaces]:
The namespace name, to serve its intended purpose, SHOULD have the
characteristics of uniqueness and persistence. It is not a goal that it be
directly usable for retrieval of a schema (if any exists).
The namespace name for XHTML is specified [https://www.w3.org/1999/xhtml/
here]:
The namespace name http://www.w3.org/1999/xhtml is intended for use in
various specifications such as: [...]
Therefore I conclude, that the validator and the StackOverflow
recommendations are wrong and nothing should be changed in the
{{{sitemap.xml}}} template.
--
Ticket URL: <https://code.djangoproject.com/ticket/33117#comment:2>
* status: new => closed
* resolution: => invalid
* easy: 1 => 0
Comment:
Florian, thanks for checking!
--
Ticket URL: <https://code.djangoproject.com/ticket/33117#comment:3>