Ticket #9419 (new Bug)

Opened 3 years ago

Last modified 17 months ago

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:

http://dev.plone.org/plone/browser/plone.app.portlets/tags/1.2/plone/app/portlets/portlets/calendar.pt#L2

http://dev.plone.org/plone/browser/plone.app.layout/tags/1.2.5/plone/app/layout/viewlets/content_history.pt#L1

I also noticed there are other templates in plone.app.portlets using the xmlns attribute in the same way.

Change History

comment:1 Changed 3 years ago by kleist

  • Priority changed from critical to major

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").

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:4 Changed 3 years ago by wichert

  • Milestone changed from 3.3 to 3.x

comment:5 Changed 2 years ago by kleist

see also #9585

comment:6 Changed 2 years ago by pelle

  • Owner set to pelle
  • Keywords TuneUp26 added

comment:7 Changed 2 years ago by jluvsu2

  • Keywords TuneUp27 added; TuneUp26 removed

comment:8 Changed 2 years ago by jessilfp

  • Keywords TuneUp28 added; TuneUp27 removed

comment:9 Changed 23 months ago by jessilfp

  • Keywords TuneUp29 added; TuneUp28 removed

comment:10 Changed 22 months ago by jessilfp

  • Keywords TuneUp30 added; TuneUp29 removed

comment:11 Changed 21 months ago by jessilfp

  • Keywords TuneUp30 removed

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.

comment:13 Changed 17 months ago by pelle

  • Owner pelle deleted
  • Cc pelle added
Note: See TracTickets for help on using tickets.