XHTML has been created with more than MIME types in mind. XHTML can be extended, can add meaning to content. And so does HTML.
Which way should I go?
I don’t know yet but Anne van Kesteren is going all the way. He converted his blog to HTML4.01. I don’t know whether this is brave or not. His arguments are pretty much the same for using XHTML but his conclusion is a bit different though.
You will not find any html, body or head tags in his source code. It validates, that is true. But does it make sense from a developer point of view?
The most important issue is still that people should start to learn and write semantic code. It makes live easier. I think that we agree on that.
However. Not closing tags causes a lot of problems for humans who are trying to read and interpret code. And I believe that this practice is the basis for what we call today tagsoup.
Let’s see what the specifications are saying. HTML doesn’t need us to close tags, only when specified that I should close my tags.
That is easy, if you know the specs by hard.
For example, if you want to put an address on a webpage, use an ADDRESS element.
<address>
some Street 45, A-25 ghostTown
</address>
This is a simple example. The ADDRESS elements needs to be closed. No problem here … if you know that this one needs to be closed. Did you?
<p> I live at <address>
some Street 45, A-25 ghostTown
</address>
</p><p>For more information send me a letter.
</p>
No problem here either, this validates too as HTML.
But do you know if the ADDRESS element is a child or a sibling of the P element?
The correct DOM tree would be something like this:
<p> I live at </p>
<address>
some Street 45, A-25 ghostTown
</address>
<p>
For more information send me a letter.
</p>
And not
<p>
I live at
<address>
some Street 45, A-25 ghostTown
</address>
</p>
<p>
For more information send me a letter.
</p>
Most webdesigners don’t know, because this kind of coding practice doesn’t help anybody to figure out what is going on. The markup doesn’t help you figure out how the elements are nested. You have to know as a webdesigner that ADDRESS is a block level element and that it cannot be enclosed by a P element.
This code relies on your memory to know the rules. Unfortunatly, most of the websites found with a quick Google search clearly show that the creators have a bad memory.
What do you think people will do when they start to write HTML: tagsoup or semantic code?
If we don’t want to end up with the next generation of tagsoup coders, ask everybody to use closed tags, think about the tags they wil use and validate their code with a strict DTD.
Here is another example with tabular data in a TABLE.
<!DOCTYPE <abbr title="HyperText Markup Language" lang="en">HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8">
<title>Hard to read but valid HTML4.01
</title>
</meta></head>
<body>
<table>
<caption>
TABLE with figures:
real tabular data in a table
</caption>
<tr>
<th>
</th><th>Name
</th><th>Street
</th><th>E-mail address
<tbody>
<tr>
<th>Adress:
<td>Ivo
</td><td><address>myStreet 01
</address>
</td><td><address>ivo ad something dot com
</address>
<tr>
<th>Adress:
<td>Dana
</td><td><address>myStreet 01
</address>
</td><td><address>dana ad stress dot it
</address>
</td></th></tr></td></th></tr></tbody></th></tr></table>
<p>
<a href="http://validator.w3.org/check?uri=referer">
<img border="0"
src="http://www.w3.org/Icons/valid-html401"
alt="Valid HTML 4.01!" height="31" width="88">
</a>
</p></body>
</html>
This is really stretching it, but the step to the messiest tagsoup isn’t that far away. Even when using code that is semantically ok.
So we’ve been dissing browsers for their lack of standards support, and now we’re going to invent our own standards all over again as it were…
Are we going back to several “official” standards again, thus returning to the previous century. Now that we finally pushed browser developers enough to support them, we’re going to dismiss them again?
Call me stupid, but I can’t see the benefit in that.
I don’t think we are going backwards with this. But we need to rethink the reasons for using XHTML.
Are the current reasons enough for using XHTML? What should we keep, what should we drop.
COMMENT:
I am more than prepared to contemplate on the reasons for or against xhtml, I just havent’ come accross a definite reasoning to dropping what we have now.
That designers are not great fans of the current xhtml 2 draft, that I can perfectly understand, I don’t really like it myself, but dropping elements like body, not closing tags anymore?