W3C home > Mailing lists > Public > www-validator@w3.org > May 2002

Validating XHTML served as text/html

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 06 May 2002 23:52:02 -0400
Message-ID: <3CD74F62.6010602@mit.edu>
To: www-validator@w3.org
I have a question about the validator's handling of XHTML served as 
text/html... I was looking at 
http://dimensional.com/~jonb/indexold.html, which is an XHTML page, 
served as text/html, containing the following code:

   <p style="text-align: center">
    <object data="lumdance.gif" type="image/gif"
            title="o/~ Anmari sowa-sowa shinaide ... o/~"
            height="202" width="97" />
    <br />
    <object data="jb.jpg" type="image/jpeg" title="jb.org license plate"
            height="149" width="296" />
    <br />

Now an XML processor would treat this page as having two <object> tags 
which are both children of the <p>.  An HTML parser, however, should 
treat this as an <object> tag that is unclosed and has as children a 
<br> and an <object> tag that is also unclosed and has a <br> child.  In 
other words, this is not a valid HTML document.

Unfortunately, the validator uses the doctype to determine the 
validation mode and parses this page as XML due to the XHTML doctype. 
At the same time, the XHTML 1.0, section 5.1 [1] says that an XHTML 
document may be labeled as text/html if it follows "the guidelines set 
forth in Appendix C".  Appendix C, section C.3 [2] explicitly says that 
things like "<object />" should not be used.

It seems to me that the validator should be flagging this mismatch 
between content-type and content as an error in the document....

[1] http://www.w3.org/TR/xhtml1/#media
[2] http://www.w3.org/TR/xhtml1/#guidelines
Received on Monday, 6 May 2002 23:52:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:58:27 UTC