Opened 3 years ago
Closed 3 years ago
#33117 closed Bug (invalid)
sitemap.xml template used with alternates for multiple languages returns an invalid xml
Reported by: | Viggie | Owned by: | nobody |
---|---|---|---|
Component: | contrib.sitemaps | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Carlton Gibson, Florian Demmer | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The generated xml has following validation error: "Error 1845: Element '{http://www.w3.org/1999/xhtml}link': No matching global element declaration available, but demanded by the strict wildcard."
This 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/"
in line 2.
Change History (3)
comment:2 by , 3 years ago
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 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.
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 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.
comment:3 by , 3 years ago
Easy pickings: | unset |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Florian, thanks for checking!
"http://www.w3.org/1999/xhtml/" without a trailing slash should be completely valid. Florian, Can you take a look?