[thelist] XHTML or HTML WAS Good Examples of XHTML Usage

Timothy Luoma luomat at operamail.com
Sat Sep 6 11:35:00 CDT 2003


>> How about restating this better... show me a real "in the wild"
>> example of an XHTML file sent as HTML that causes a browser to fail.
>
>This is a strawman argument. I never said that sending XHTML as HTML
>(assuming it complies with XHTML 1.0 Appendix C guidelines) would
>cause Tag Soup ("HTML") renderers to fail.

and I didn't say you did.  I was raising a new point that in the wild this 
has no real side effects on actual browsers.

Arguing about theoretical problems assumes things are going to get more 
strict in the future.  I don't think they are.  I believe an UAs are going 
to have to get more adept at deaing with problems.


>> I think I was referring to the "Evil Mangled Comments Embedding Hack"
>>
>>    <script type="text/javascript"><!--//--><![CDATA[//><!--
>>      ...
>>    //--><!]]></script>
>
>The fact that you have to go to such extreme lengths to embed style
>and script into your documents should be setting off alarm bells.
>
>The fact that nobody uses the above is even more telling.

using external scripts is a much better idea for a number of reasons... I 
guess this is one of them.

But it is possible.


>>>> Show me a browser that can't handle <link /> but can handle <link>
>>>
>>> No browsers handle <link/> according to the HTML4 spec.
>>
>> That's not what I asked.
>
>So what do you mean, "show me a browser which parses <link/>
>incorrectly"? Most of them do, as far as I know.
>
>How is that relevant?

What is relevant is that to the user, this isn't going to be something that 
bothers them.

>If all you are going to do is rely on the UAs' error handling code,
>why bother trying to make your markup valid at all? Just write pure
>Tag Soup and be done with it.

because I prefer to try to write valid XHTML to HTML, howevermuch that 
seems to bother you.

>It doesn't matter _what_ browsers are "dead" when you switch MIME
>type. The point is that if you write XHTML now, and send it as
>text/html, a huge number of those documents _will_ break if you change
>the MIME type.

so I won't change MIME types.


>Your own article, for example, as mentioned below.
>
>Now, given that there is little or no chance that these errors will
>ever be corrected, and that there is therefore no chance that the MIME
>type will ever be changed from text/html, why would you use XHTML?

I prefer it.


>Why is
>
>   <link ... />
>
>...and "stricter" than:
>
>   <link ... >
>
>...? Both are just as valid in their respective languages.

closing tads for P abnd LI and UL etc are more strict

 
>It's probably even faster to write perfectly valid HTML, e.g.:
>
>   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
>   <title> ... <title>
>   <p> ...
>
>...which is perfectly valid.

no it's not.. I left the doctype out entirely... And even HEAD.  Like I 
said, it was bad HTML. 


>
>> I also said that XHTML was easier to parse and makes it easier to
>> transition to understand some XML concepts.
>
>It is a lot _harder_ to parse if you are just sending it to an HTML4 /
>Tag Soup parser and hoping it turns out right. When sent as text/html,
>XHTML uses the same parser as HTML4: It is not any easier to parse.

but I'm not just sending it to such a parser.  I'm using a parser that 
needs closing tags.

>> If you use HTML4 instead of XHTML you aren't going to get parsing
>> warnings either.
>
>No, but at least you don't have to rely on possibly-changing error
>handling behaviour.

again, error handling is in practice only going to get better, not worse.  


>> Another part of the inconsistency is that I wrote a PHP snippet to
>> send me application/xhtml+xml when using Mozilla or Opera. Now that
>> Opera 7.2 sends the right HTTP_ACCEPT headers, I will probably start
>> using that more often. So when I am looking at my own site from my
>> own computer, I will be getting application/xhtml+xml (or whatever
>> that dreadful MIME type is). So I can get the benefit of XHTML
>> without having to inflict it on other people.
>
>See appendix B of my document:
>
>   http://www.hixie.ch/advocacy/xhtml
>
>
>I've also updated the document to take into account some of your
>comments.
>

unfortunately it doesn't display properly in my Treo.

I've spent far too much time on this topic.  Feel free to post any followup 
comments you have but I think I'm ging to move on... It's just not that big 
of an issue to me.

TjL



More information about the thelist mailing list