arrow-left arrow-right brightness-2 chevron-left chevron-right facebook-box facebook loader magnify menu-down rss-box star twitter-box twitter white-balance-sunny window-close
XHTML 1.0 validation
1 min read

XHTML 1.0 validation

Well, as is usually the case, my inner-nerd took over and told me that this webpage needed to validate as XHTML 1.0. I couldn’t wait for the managers of the CMS I’m using to make the move from HTML 4.x to XHTML 1.0, so I went ahead and did it myself this morning.

Surprisingly, it wasn’t that tough. I used a progam called Tidy to do most of the converting. The only real problem is that as configurabe as Tidy is, I could find no way to tell it not to insert the main HTML tags (ie, html, body, !DOCTYPE, etc ). This was a problem because the website is dynamic and pages are built on-the-fly from smaller HTML files through PHP. When I went to convert all of these ‘partial’ HTML files to XHTML they would convert just fine BUT would have all those extraneous (in this case) tags, which I had to remove.

After all of that was done, I started testing the validity of the site. I ran into a few problems because, again, Tidy treats all HTML files as if they are the only file being used and not as if they are part of a template system. Most of the hang-ups were just a matter of figuring out what start tags went with what end tags in the final, PHP-produced HTML file. Nothing major. I also went ahead and made sure that my CSS was valid as well. You can check the XHTML validation here and the CSS validation here.

You've successfully subscribed to Justin Blanton.
Success! Your account is fully activated, you now have access to all content.