Converting a few documents by hand is one thing, but what if you want to convert a hundredor a thousand web documents to XHTML? You can partially automate this process by using automated tools like HTML Tidy and Dreamweaver extensions.
HTML Tidy, a free, standalone, W3C-approved tool, can automatically convert your web pages from uppercase to lowercase markup, your font tags to equivalent style sheet rules, and more. Originally developed by HTML 4's primary author Dave Raggett, Tidy is now maintained as open source at SourceForge ( tidy.sourceforge.net ). As its name implies, Tidy can clean up your code, point out problem areas, and pretty-print your (X)HTML. Tidy is quite powerful, so be sure to read the manual and make a backup before you tidy up your code.
One little-known option in Tidy is the -o option for optimization. This undocumented flag performs rudimentary whitespace removal to shrink your code.
Tidy has been ported to Java and Perl, a number of platforms (including DOS, Windows, and Mac), and embedded in a number of third-party programs, including BBEdit (http://www.bbedit.com/), EVRSoft's 1stPage (http://www.evrsoft.com/), HTML Kit Web Editor (http://www.chami.com/ html-kit /), Notetab (http://www.notetab.com/), and Mozquito Technologies' Factory (http://www.mozquito.com/).
Jason Dalgarno has created a Dreamweaver extension (http://home.clara.net/locust-star/) that converts HTML pages into XHTML. The tool will do the following:
Add closing tags.
Close empty tags.
Add (or replace) DOCTYPE and xmlns attributes.
Quote unquoted attribute values.
Unminimize Boolean attributes.
In addition, the tool will optionally clean up <script> tags, copy name attributes to id attributes, add blank alt attributes for alt-free images, and run commands site-wide.
Make a backup before making these changes, and be especially careful with site-wide commands. For the latest Dreamweaver extensions, visit Macromedia's Dreamweaver exchange at http://www.macromedia.com/software/dreamweaver/.