W3C home > Mailing lists > Public > public-html@w3.org > September 2007

Re: Prevalence of ill-formed XHTML

From: Philip Taylor <philip@zaynar.demon.co.uk>
Date: Sat, 01 Sep 2007 14:32:30 +0100
Message-ID: <46D969EE.4000902@zaynar.demon.co.uk>
To: Robert Burns <rob@robburns.com>
CC: "public-html@w3.org WG" <public-html@w3.org>

Robert Burns wrote:
> What problems would an author face with actual browsers if they 
> authored valid and well-formed XHTML 1.0 that also adhered to the 
> appendix C guidelines and then delivered that content as text/html? I 
> cannot think of any and I've yet to hear any issues presented (Note that 
> adhering to appendix C means there's no CData sections and <script> is 
> always closed with </script>).

http://www.w3.org/TR/xhtml1/guidelines.html doesn't say anything about 
not using CDATA sections.

It does say "Use external style sheets if your style sheet uses < or & 
or ]]> or --. Use external scripts if your script uses < or & or ]]> or 
--" but it doesn't indicate that code like:

   <script type="text/javascript">
   alert("Hello world");

is a JS syntax error in text/html, nor that

   <script type="text/javascript">
   if (5 &gt; 2) alert('OK');

is a syntax error too.

XHTML code like:
in Firefox results in "Text" on the second line of the text area. (Opera 
and Safari disagree. I think XHTML5 agrees with Firefox). When you send 
that as text/html, the leading newline will be ignored, so you will get 
data loss when submitting the form.

The checked, disabled, readonly, etc attributes can't be used at all in 
a document that follows Appendix C's advice to work in old UAs.

(I expect there are plenty of other issues - it seems it would be hard 
to write something like Appendix C that is actually correct.)

Philip Taylor
Received on Saturday, 1 September 2007 13:32:38 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:21 UTC