Anne van Kesteren

Thoughts about XHTML and HTML

When I began learning about the web, the new language only some people were talking was XHTML. It sounded interesting to me, but I was afraid it was not that widely supported as HTML. I was proven wrong, but theoretically I was right, I discovered the last few months :-). Hmm, actually I was not right, I didn't even knew what XHTML was about.

I also thought that XSL (I didn't knew about it, I only knew it existed, I didn't know for example that there were two versions...) was the replacement for CSS. Now I understand (probably because I read a lot about, since then) they can be used together with superb results, like Dave shows us. The problem was back then that I (and Arthur) thought that XHTML was right between HTML and XML, we were so wrong... Arthur didn't want to use it. If we were going to do it right, we had to choose right for XML for structure and XSL for styling our documents.

Why using XHTML is evil (most common arguments):

Probably there are more thought, or more thought through arguments, try Hickson's Sending XHTML as text/html Considered Harmful, for example. BTW, make some time to check the rest of that directory; he also has some nice words for XSLT and XSL-FO :-). But that is not the point. There are problems with XHTML; we are currently sending it as tag-soup (though there are ways to avoid such a problem). In short: authoring XHTML is maybe not the most valid way of building websites, though it is the way that makes it easy to create them.

XHTML has clear rules, you may not omit the html, head and body elements, like you may do in HTML4.01 Strict. For example: You have to close every single element. You must quote your attribute values. You must write in lower case. You can also use XHTML within other XML languages using namespaces.

Some people think/thought that XHTML also doesn't allow you to design like you did in '95, but that is just plain stupid. You may design like you did back then. The HTML4 flavors are exactly the same as the XHTML1.0 flavors. Only the syntax differs a bit. It is of course not correct if you still design like you did in '95 (should be a bit later, like '98, but this reads better) or '00, but it is possible, that is a fact.

I think I missed some points, like I always do, when I am writing an entry. The advantages zlog gave: XML is good because... are the ones I agree with. About the MIME nonsense: Just make sure it is valid! Validate it once a week (or month), check multiple pages and so on. Just make sure I can hack into your site add a little script that serves it as application/xhtml+xml towards Mozilla and I can still browse through everything. Over 5 years when our out of date websites are going to be archived, you will be glad you choose for XML and not for SGHML (=HTML), since those who have chosen the right markup language can easily archive everything with the ease of XML tools!


  1. Posted by Mario De Zutter at

  2. Mario,
    I was a little bit lazy regarding minzweb, and I am facing problems with my hosting company.
    But it is not dead!

    Posted by Minz Meyer at

  3. Mario,
    In de wereld van regelmatig updaten komt er wel eens een foutje in je pagina. Gelukkig ging het hier alleen om een niet geldig karakter, vanwege het kopieren van een titel van een externe fout. Waardoor het geheel niet tot een crash leidde in betere browsers.

    Mijn pagina werkt incorrect in elke browser, alhoewel IE wel het toppunt is.

    The Matrix heeft een plaats op mijn site, als je vindt van niet, begin dan een eigen weblog, waar hij niet in voorkomt.

    Posted by Anne at