2005-12-06

Beware of XHTML

XHTML is great and we really need something like this to succeed. That is precisely why you shouldn't use it. Most XHTML webpages, including valid ones, are currently written to be handled like HTML documents, which is going against the whole purpose of XHTML: to reformulate HTML in XML. My new web design article, Beware of XHTML, attempts to explain the problems with current usage of XHTML and why you should stick with HTML until Internet Explorer and other web applications support it correctly.

2 comments

F-Man

Hello Nanobot.

This is a great article, but I would like to explain some reasons why I think it shouldn't be seen as such a bad thing to use it.

When I make XHTML documents served as text/html, I first make sure to not use XML features like importing another XML language or using CDATA. You said that style and scripts must be used with CDATA in XHTML, but that's actually only necessary if you use markup characters like "<" or "&". The Appendix C strictly says to use an external file in a case like this, which resolves all problems. All of my pages work the same that they are text/html or application/xhtml+xml.

Of course everyone who uses XHTML as SGML should follow the Appendix C, if not, then I completely agree with you to not use it.

After all, the sole purpose of using XHTML that way is to make it easier to update to real XML in the future, so that's why I think it should be fine as long as you are sure your document will not break if you switch the MIME type.

Nanobot

The fact is that people typically don't read the spec. At most, your typical web developer will make sure the document validates, and improperly written XHTML can still validate. If you really know what XHTML is and how to use it correctly, then there's nothing wrong with doing so. But unfortunately, as evidenced by the large amount of malformed and otherwise incorrectly written XHTML on the Web, you're very much a minority.

Post new comment

Comment moderation policy: Your comment will be reviewed before it is added to the site. This is in response to spam and other forms of abuse. I gladly accept comments containing criticism as long as the language is clean.

This weblog is powered by Blogger.