Re: Prevalence of ill-formed XHTML

Robert Burns wrote:
> On Sep 1, 2007, at 8:32 AM, Philip Taylor wrote:
>> http://www.w3.org/TR/xhtml1/guidelines.html doesn't say anything about 
>> not using CDATA sections.
> 
> Yes it is true that appendix C does not say do not use CDATA sections, 
> however, in best-practice circles that is how it is  commonly 
> interpreted. That is authors keep both scripts and stylesheets external 
> and therefore have no reason to use CDATA sections.
> 
>> 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'm not aware of any browsers that do not support unminimized boolean 
> attributes. How widespread is that issue?

If you don't actually follow Appendix C, and instead use some new rules 
(like never using CDATA) and ignore some old irrelevant rules (like 
boolean attributes) so that you're following an unwritten set of 
guidelines to produce documents with XHTML markup that work as 
text/html, then documents following that are going to work as text/html, 
by definition :-)

>> XHTML code like:
>>   <textarea>
>>   Text</textarea>
>> 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.
> 
> If I understand you correctly, this is an issue with XHTML 
> interoperability and not an issue with serving XHTML as text/html.

It's an issue with writing "valid and well-formed XHTML 1.0 that also 
adhere[s] to the appendix C guidelines", with just markup and no scripts 
or styles, then having it break when you send it as text/html. You need 
an extra step to convert the XHTML into not-quite-XHTML before it can be 
sent as text/html safely.

-- 
Philip Taylor
philip@zaynar.demon.co.uk

Received on Saturday, 1 September 2007 20:51:42 UTC