Thus far, you've read the HTML 4.01 and XHTML 1.0 documentation and you understand their relationship. You have successfully converted a few documents to XHTML 1.0. So, how do you know that your documents are really XHTML 1.0 compliant?
The easiest way, as stated earlier, is to use "xmllint." It was distributed with later versions of libxml, which can be obtained from xmlsoft.org. Once properly installed, you can use xmllint to check your work. Your command line entry will look like this:
xmllint --valid --noout mydoc.html
If you receive error messages, your document is not XHTML compliant. Read the error messages and fix the code in your page. Keep checking the page with xmllint until it is ready to go.
After xmllint spits out your document with no errors reported, it is time for the final stamp of approval, W3C's HTML Validation Service. This works for HTML and XHTML 1.0. If your document passes the test, they even give you a little icon that you can display on your page to assert its validity. If you put the icon on your page, just be sure to check again from time to time just to be sure you're still as cool as you say you are.
Even truly compliant XHTML can be just as messy and incomprehensible as the most Swiss-cheesed, non-standard HTML. The W3C kindly offers guidelines for keeping it clean and making your Web pages accessible to all. The documents "Techniques for Web Content Accessibility Guidelines"
and "Web Content Accessibility Guidelines" both offer suggestions for
making your Web pages accessible to the largest audience possible.
Some document collections have hundreds of pages that need to be converted, but it would take hundreds of hours to convert them by hand! Our friends at the W3C are here to help us with that, too. Aren't they nice? HTML Tidy can offer a great deal of help -- some people run every
document they write through this before publishing it. HTML Tidy can be used to automatically indent your code, change the case of HTML tags, add and remove entities, and more. Just remember, even if HTML Tidy goes and tidies up your code, you still need to run the resulting
code through xmllint and the HTML Validation Service.
Making your documents XHTML 1.0 compatible is a first step to using a slew of XML utilities. For instance, editing documents with more decorative tags than content can be a pain, but you can use XSL to preprocess your documents and make them easier to edit. Keeping your humanly editable documents in strict XHTML and then putting in bells and whistles with XSL afterward makes it easer to maintain a document and can keep all of your stylistic flourishes separate from your content.
Maintaining compliant Web pages can reduce the error checking of browsers, which will hopefully also reduce the degree to which browsers are becoming bloated. Of course, the smaller the browser, the greater increase we will see in the speed at which pages are displayed. If XHTML, XML and XSL catch on, our pages will become truly cross-platform and consistent across multiple browsers.
Oh, can't you just see it?