Skip navigation.

Harold's Home

XML version of this site

PHP Scripts

CLI fun
Mail on 404
HB-NS (NewsScript)


APOD to Desktop
Dreamweaver Extensions


Other stuff
Central Grinder

OOOk Default:

VJ stuff
VJ Tools
Sample Movies


Moving to XHTML
As I mentioned earlier I moved the site to XHTML this week.
I thought I'd mention how the process went so that perhaps others can learn from it. I know I learned a lot and will be reviewing the other sites I maintain so as to make the process easier in future.

The old site was entirely in valid HTML 401 transitional and while I always took care to write all tags in lowercase and close all my tags even though the specs didn't always require this I still had some problems. In fact almost all pages had some kind of problem and some still do, I'm still updating pages and I expect that the entire process will take me some time as all this is done in my holidays and I have a stack of books to read too and holidays are apparantly also for having fun.

So what were the biggest problems I encountered?
Well, unclosed tags for one. I know, I said I took care to close all tags, but some of the pages on this site date from way back (HTML 4 was just being thought up then) and while the layout may have changed since then, most of the content hasn't been updated as the pages are considered a done job. This means that there were a lot of unclosed paragraph tags.
Another problem turned out to be unquoted attributes, especially in PHP forms.

As I wrote in a comment on the previous post I whipped up a grep pattern to XHTMLify my image tags. The same process was useful for horizontal rules. However, due to the complexity of HTML this process couldn't be applied to tags like P. Another problem was the fact that a lot of the pages on this site use PHPtags and quoted attributes must be escaped there so just running a batch job on those wouldn't work.
I suppose I could have looked into perl or somesuch tool to do the job but that would require me to really learn the language and I lack the inclination right now. Besides: I'd rather revisit all my old pages and correct a few typos as well in the process.

So what did I learn exactly:
- Quote all your attributes
- Close all P tags
- Valid XHTML can still work with table layouts
- A good texteditor is worth the money (as if I didn't know already)

Validation is really easy, just add the following bookmarklet to your toolbar: ValidateMe
Visit a page, click the bookmarklet and start your editor and FTP client.

If you're on the web now and do all your code yourself it's highly likely you too will want to make the move to XHTML or whatever follows it. Taking a good look at what you do now and how you work will save you a lot of time later on.

Show all items | Read all items

About, copyright, privacy and accessibility | Mail