Ticket #9419 (new Bug)
XHTML validation fails: "xmlns" attribute used with non-root elements
| Reported by: | esartor | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 3.3.x |
| Component: | Templates/CSS | Keywords: | |
| Cc: | wichert, keul, pelle |
Description
Plone generates non valid XHTML. I checked the validator against the default front page in a Plone 3.3rc5 default site and got two errors:
Line 919, Column 20: Attribute "xmlns" is not a valid attribute. Did you mean "onmouseup" or "onmouseover"?
<div xmlns="http://www.w3.org/1999/xhtml"
Error Line 1002, Column 11: Attribute "xmlns" is not a valid attribute. Did you mean "onmouseup" or "onmouseover"?
xmlns="http://www.w3.org/1999/xhtml">
The errors are caused by the lines:
I also noticed there are other templates in plone.app.portlets using the xmlns attribute in the same way.
Change History
comment:2 Changed 3 years ago by kleist
- Summary changed from XHTML validation fails to XHTML validation fails: "xmlns" attribute used with non-root elements
comment:3 Changed 3 years ago by wichert
Isn't this a bug in zope.pagetemplates instead of Plone? It should strip the xmlns attribute on included snippets.
Having xmlns in the portlet templates makes sense since those files are HTML, and declaring the namespace for them allows you to validate them.
comment:12 Changed 19 months ago by keul
- Cc wichert, keul added
As this bug is still there I'm wondering what is the way to fix this.
Is the wichert way (so opening some kind of bug to zope.pagetemplates) or fixing this in Plone. This is still a problem for all who want (need) to get XHTML Compliant pages.

The reporter is right: The "xmlns" attribute must only be used with the root element (i.e. in the "html" tag):
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd (line 273-278)
(online version here: http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Transitional)
However, we should reserve the priority "critical" for issues that more or less breaks the functionality of Plone, so I'm demoting to "major" (after having resisted the tempation to use "minor").