Skip Navigation LinksHome > View Post

Why I love XHTML

The reason I love XHTML is because it is such a simple transition from HTML and results in code which is easier to maintain, read and, being an application of the XML standard, it is also extensible! I mentioned in an earlier article that support for XHTML compliance in Visual Studio 2005 has improved immensely so there really is no reason why ASP.NET developers should not develop XHTML compliant web sites.

In this post I hope to list some of the main advantages of switching to XHTML. There is nothing new here, but I am recapping on these advantages to introduce the theJoyOfCode.com's Validator Module which eases the development of XHTML compliant web sites in ASP.NET 2.0.

Standardization and Accessibility

Because XHTML enforces rules on the use of tags and attributes in a document it is easier for browsers to consistently render the page. I have seen plenty of web sites designed where the CSS files contain duplicated code (CSS hacks) to make a design work cross browser. Once the site has been re-written these CSS hacks have become obsolete. The probability of a web site working as expected in future releases of browsers also increases. Any web developer which uses the excuse that he does not have time to switch to XHTML will ultimately spend more time maintaining a non XHTML compliant web site.

A valid XHTML document is much more accessible to a variety of browsers and other internet devices (including hand held PDA's) and it also makes search engines job easier in interpreting the markup of the page, which could result in the page scoring higher.

Cleaner code and best practices

XHTML strives to separate document layout from presentation. It's something of a holy grail but makes your site easier to maintain. XHTML documents must be well formed so no more searching for subltle errors in your HTML that are creating those niggly rendering errors that are so hard to track down. Many HTML best practices are required in XHTML so once you make the step to write XHTML documents you are writing better code! Tidy!! :D

XML tools available

Since XHTML is also XML it means that several tools are available to develop and maintain your XHTML documents. It used to be a pain to maintain and code XHTML documents, because the editor tools would seldom offer good support if any towards compliance. Not so anymore!

This last point leads me to the real reason I have written this article. My good friend Josh has written a wicked module for ASP.NET 2.0 which validates your XHTML markup on the fly. This is particularly useful when developing dynamic web applications (which is granted if you are using ASP.NET!!)

theJoyOfCode.com's Validator Module is coming soon. Subscribe to one of our feeds or e-mail us if you want us to notify you when it's released (within a couple of weeks).

UPDATE: The Validator Module has now been released. Find out more in Josh's post about the Validator Module.

Tags: ASP.NET

 
Bruusi Post By Bruusi
6:43 AM
16 Jan 2006

» Next Post: IE7 finally fixes the SELECT control
« Previous Post: Is a script tag slowing down your web page

Comments are closed for this post.

Posted by Innovateidea @ 10 Feb 2007 3:31 AM
Check my site all are vaild xhtml 1.1 i really love to work with this new w3 std...

© 2005 - 2014 Josh Twist - All Rights Reserved.