You are here: Re: most XHTML on the web is invalid? « HTML « IT news, forums, messages
Re: most XHTML on the web is invalid?

Posted by Jukka K. Korpela on 02/05/06 10:02

John Salerno <johnjsal@NOSPAMgmail.com> wrote:

> What exactly does this mean:
>
> "Document sent as text/html are handled as tag soup [1] by most
> UAs. This means that authors are not checking for validity, and
> thus most XHTML documents on the web now are invalid. Therefore the
> main advantage of using XHTML, that it has to be valid, is lost of
> the document is then sent as text/html."

Looks pretty clear to me, though the phrase "it has to be valid" is
actually just a successful meme (in a particular environment), not a
correct statement of facts. It is apparently meant to say that browsers
_must_ check for validity (for documents, HTML specifications have
always required validity), but what the XHTML 1.0 document actually
says is something very different. It only requires that well-formedness
(i.e., being XML in the first place) is "evaluated" (with no
requirement on reporting the result of the evaluation), and there is
clearly no requirement on checking validity:
http://www.w3.org/TR/xhtml1/#uaconf
In fact, XHTML 1.0 even _requires_ certain processing of unrecognized
elements and attributes, which means rules for processing _invalid_
documents. In classic HTML, this was just common practice (and a
_suggestion_ in the specs).

> To me it sounds like he is saying that *any* document written in
> XHTML and then served as text/html is invalid.

No, that's not at all what it says.

The general idea is that authors who think they are using XHTML do not,
in fact, use XHTML (but violate validity requirements, prose
requirements, and perhaps even well-formedness requirements) and do not
observe this, since browsers don't report the errors. The idea seems to
be that browser _would_ report errors if application/xhtml+xml were
used, but as I explained, there is no such requirements - and browsers
are even _required_ to process invalid documents in a particular manner
(though we can perhaps deduce that they _may_ also flag errors).

> I assume if you validate your XHTML, then simply serving it as
> text/html doesn't harm it, right?

Right. But you gain nothing either.

> It doesn't suddenly make it
> "invalid," does it? (Perhaps in a strict sense it does, because
> it's not truly XHTML, but as far as the actually words in the
> document themselves, - -

Validity has nothing to do with the Internet media type used to serve a
document. Validity is an inherent property of a document.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация