spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / authoring / xhtml

ASP 3.0/.NET Developer
Jupitermedia
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Search
The Business Internet

Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0

Why Switch to XHTML?

By Lee Underwood

For Web developers, the learning process never seems to end. New technologies are constantly being developed, the manipulation of multimedia seems to know no bounds, the proliferation of knowledge, distribution and programming languages continue to develop and grow, and, of course, design standards are constantly being upgraded in an effort to keep up with it all.

The coding of Web pages is one place where the learning appears endless. Depending upon how long you've been coding, you may have gone through a few "upgrades" of HTML, culminating in version 4.01. These "upgrades" are a part of the standards set by the World Wide Web Consortium (W3C) in an effort to develop common protocols to ensure the continued interoperability of the World Wide Web.

The latest version of HTML is 4.01, which was a minor update of 4.0, and was released in December, 1999. However, it's not the current standard for coding Web pages, according to the W3C. The new standard (or "upgrade") is XHTML 1.0, released January 2000, and revised August 2002.

What is XHTML?

According to the W3C, "XHTML 1.0 is a reformulation of HTML 4.01 in XML, and combines the strength of HTML 4 with the power of XML." This means that, by using XHTML, you are adding the potential of the power of XML to your Web pages. A discussion of XML is outside the scope of this article but there are many resources to further your study on the subject (just what you need, something else to study). But if all this sounds rather complicated, it really isn't.

Basically, XHTML is strict HTML. In the past, it was possible to get away with a lot of sloppy coding. That now changes under XHTML:

  • a doctype indicator must be included in all documents
  • tag names must be in lowercase
  • all documents must be properly structured
  • all tags must be properly nested
  • all tags must be closed
  • all attributes must be quoted
  • the <title> tag must come first in the <head> tag.

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 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 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.

The Work of the World Wide Web Consortium

The W3C sets the standards for the World Wide Web. It's a fact of life. It's to everybody's advantage to comply with these standards. It is these standards that Microsoft, Netscape, Mozilla, and others consult when they design new versions of their Web browsers. It is also these standards that are used by multimedia companies and others when designing new software for the Web.

According to the W3C, "the purposes of the Consortium are to support the advancement of information technology in the field of networking, graphics and user interfaces by evolving the World Wide Web toward a true information infrastructure, and to encourage cooperation in the industry through the promotion and development of standard interfaces in the information environment known as the 'World Wide Web.'"

The standards set by the W3C allow Web developers, designers, coders, programmers, software manufacturers and others to all march to the same tune. In complying with the standards, we all end up with a faster, smoother, more functional Web. That's why they are called "standards". With the rapid development of the Web, compliance with standards is a must so as to keep pace with emerging technologies. If you want your Web pages to display correctly in the next generation of viewing devices, it is imperative that you follow the W3C's recommendations.

A well-written XHTML document is guaranteed to display in a standards-compliant browser (which most are today) because of the W3C specifications. No longer do Web sites need to display the notice: "This page is best viewed with XXX browser".

Onward to Bigger and Better Things!

Is it possible to continue to code in HTML 4.01 and still have viewable Web pages? Sure, and it may be that way for some time to come. However, technology changes rapidly. Failure to respond rapidly can be detrimental for your clients and yourself. Changing course now allows for a smoother transition later.

As you migrate to coding in XHTML, you're laying a foundation for the future. As new opportunities open up, you'll be prepared by complying with the standard today. The World Wide Web provides opportunities that are not available in any other realm; its possibilities seem endless. Yet, there are still rules we must follow in order to navigate its uncharted waters.

 

home / authoring / xhtml
Access FREE HP High-Availability Solutions for Exchange 2007 Tools:
Whitepaper:
Backup and Recovery Best Practices for SQL Server 2005, Including HP Data Protector
Whitepaper:
Configuration Best Practices for Microsoft SQL Server 2005 with HP EVA4000 and HP Blade Servers
Whitepaper:
Best Practices for Microsoft Exchange 2007 with HP Server and Storage in Mid-range



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP

Created: May 2, 2003
Revised: June 7, 2004

URL: http://webreference.com/authoring/xhtml