Converting from HTML to XHTML

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 ( ). 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 (, EVRSoft's 1stPage (, HTML Kit Web Editor ( html-kit /), Notetab (, and Mozquito Technologies' Factory (

Dreamweaver Extensions

Jason Dalgarno has created a Dreamweaver extension ( 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


Speed Up Your Site[c] Web Site Optimization
Speed Up Your Site[c] Web Site Optimization
ISBN: 596515081
Year: 2005
Pages: 135 © 2008-2017.
If you may any questions please contact us: