What is xHTML ?
XHTML is a combination of HTML and XML (EXtensible Markup Language). It consists of all the elements in HTML 4.01 combined with the syntax of XML. In other words, xHTML is the reformulation of HTML as an XML application. In other words, XHTML looks at HTML through the eyes of XML. The rules and methodologies of XML are applied to HTML, bringing syntactical strength back into HTML, which lost that strength during its rapid evolution from text document markup language to the de facto language of visual design.
XHTML 1.0 is the first version of XHTML, which is a fairly rigid markup language. Its rules are very straight-forward, and there's really little extensibility involved in XHTML in that you can't write your own definitions as to how the language behaves. You've got to follow the rules. XHTML 1.0 also adopts concepts introduced in HTML 4.0--which in and of itself asks some structured behavior from anyone using it to markup documents or creating software-be it a visual editor or a Web browser.
What's Wrong with HTML?
HTML is the set of codes (the "markup language") that a writer puts into a document to make it displayable on the World Wide Web. HTML (HyperText Markup Language) has been the lingua franca of the World Wide Web since its inception in 1990. It has gone through several revisions, and is now at version 4. Although it has been enormously successful, the language is no longer suitable as a basis for the deployment of commercial and industrial web-based applications on the Internet and intranets.
HTML will not go through another revision, except as an application of XML, i.e. XHTML. HTML has been enormously successful and one fully expects XHTML to be of great interest to web developers now that it's a W3C Recommendation.
Why use xHTML?
If you want to look at XHTML 1.0 a little more closely, begin by assessing the information needs of your design group. If you're a one-person shop, it's going to be a bit of a commitment to learn XHTML 1.0 and transition documents. If you are an art director or designer working with a team--this is something you may recommend to your HTML folks to look into. There are some excellent resources on XHTML that are much more accessible than the W3C documents, I recommend them in the Resources section at the end of this article. This will get you or your document folk off to the right start.
There are some considerations of which to be aware when saying "yes" to XHTML 1.0:
- Be aware of presentation limitations. Even though it's not required in transitional XHTML 1.0 documents to use CSS for presentation, some proprietary tags and attributes have been omitted from the transitional definition for XHTML. The ideal XHTML document relies on CSS for presentation. But we all know that CSS, despite its promise, is less than ideal in the way browsers support it. A perfect example of this is anything to do with box properties. Margins and borders are especially problematic. Let's say you've been using the topmargin="x" attribute in your body tag to gain more control over your margins. Well, you can't do it in XHTML. The topmargin attribute was left out of the definition, and CSS support is inadequate. As a result, you lose effective, interoperable control of margins in valid XHTML documents.
- Be aware of integration concerns. Do your sites integrate markup from any other source? One example of this that I learned the hard way came with markup that is provided to WebReview.com by its ad servers. The markup is poorly formed, and when dropped into our sexy new XHTML documents, renders them invalid. Do they still display? Absolutely. But do the documents validate? No, they don't. Any markup that comes at you from another source will have to be rewritten to comply with XHTML syntax. If that markup is delivered dynamically, you'll be facing the difficult task of convincing the individuals responsible for that markup to switch to XHTML--as if doing it yourself weren't time consuming enough.
- Consider the scope of your project. Transitioning large sites to XHTML is a decision that is entirely up to you. You might end up dealing with concerns, as I have, that your markup doesn't validate as XHTML despite your best intentions because you didn't assess what ad codes might do to the site. When you've got a few pages, that's one thing, but when you've got 10,000 pages, it's maddening! What's more, once you've made the choice of using XHTML, you will also need to consider that some of those documents will require further technologies, design approaches, or updates in order to effectively reach wider audiences via wireless or alternative devices.
