Not that I care about validity if the site works. Just want to know what to say if someone complains. :)


Robert Castelo’s picture

Drupal produces completely valid xhtml.

If you are having problems it might be due to the theme being used or the content of pages.

Do you have a URL of the problem page?

[a.k.a. MegaGrunt]

Drupal Specialists: Consulting, Development & Training

Robert Castelo, CTO
Code Positive
London, United Kingdom

TDobes’s picture

The only reason doesn't validate is because its theme uses the <wbr> tag. It seems that this theme is being actively tweaked and improved, so this may be only a temporary situation. Regardless, those particular tags are the only thing keeping it from validating.

Most pages on Steven's site, (which also uses Drupal) validate just fine.

Kjartan's site, is another valid Drupal site.

In general, Drupal itself uses valid XHTML. True, there are a couple instances within Drupal's administration that do not validate, but they exist to make things more usable, and would not normally be visible to the public. (Most notably the wrap="virtual" which appears in textarea tags.)

So... to answer your question, Drupal itself (including the core themes and most contrib themes) does in fact validate. Chances are that the sites you've witnessed that DON'T validate have an admin who has consciously made a choice that having a few elements that aren't valid allows them to make their design better.

iraszl’s picture

thanks! that explains it. i'm happy now. :)

rhartmann’s picture

Well, the HTML header of the Drupal site I'm playing with contains
the following element:

<link rel="alternate" type="application/rss+xml" title="RSS" href="">

... which doesn't validate as XHTML because it should end with "\>".

Steven’s picture

If you search you can find the patch to fix this locally, it will be included in the next Drupal release.

And actually, it should end with a forward slash :P.

If you have a problem, please search before posting a question.

frjo’s picture

This bug in drupal_add_link is fixed now, see