Why Switch to XHTML? A Glance at an XHTML Document Lee Underwood
A Glance at an XHTML Document
There are some other rules, but you get the idea. A glance at an XHTML document would basically look just like one coded in HTML 4.01:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Basic Document</title>
</head>
<body>
<p>Every good boy does well.</p>
</body>
</html>
(In order to allow for older browsers, the first line can be eliminated and a meta tag used instead.)
So Why Switch to XHTML?
For many Web developers, it's almost certain that this question keeps popping up. What's the big deal? If it's just strict HTML 4.01, why can't I just tighten up the code I write now? Why do I have to do what the W3C says?
It's not so much an issue of "strict code" as it is an issue of compatibility and conformity. For the majority of our readers, web site development is their life's work; it's what pays the bills and puts the food on the table. In that scenario, you must be moving with the flow in order to provide the highest level of service for your clients. Even though XML might not be a part of your current projects, you might be working with it in the future, and it may be with the same pages you are coding today. With a few slight changes in your workflow, you can ease the transition to the future, making life easier for yourself and offering additional possibilities to your clients. If a situation requiring XHTML-coded documents presents itself down the road, you'll be able to respond quickly, having already laid a solid foundation with the proper coding.
As I mentioned earlier, writing XHTML is not much more difficult than writing HTML 4.01. In fact, once you get used to it, it's actually easier, as the code is cleaner and more self-explanatory. Because the format is strict, the code is clean, and web browsers are able to display the page quicker than one with errors and unformatted code. Software companies, such as PAKSoft with its Hyerpertext Builder 2003, are also beginning to offer editors that are more XHTML-compliant.
XHTML provides greater control over documents viewed in a variety of browsers and other devices, i.e. cellular phones and Braille devices, which leads to better accessibility. Better accessibility leads to more page views. While your clients might not be concerned with seeing their documents in anything other than a basic web browser, the technology of the future demands portability to other platforms.