HTML and CSS Reference
Once you have achieved well-formedness, the next step is to check validity. You simply add the --valid switch
on the command line, like so:
$ xmllint --noout --loaddtd --valid valid_aw.html
This will likely produce many more errors to inspect and fix, though these are usually not as critical or
problematic. The basic approach is the same, though: Start at the beginning and work your way through until all
the problems are solved.
Many HTML editors have built-in support for validating pages. For example, in BBEdit you can just go to the
Markup menu and select Check/Document Syntax to validate the page you're editing. In Dreamweaver, you can
use the context menu that offers a Validate Current Document item. (Just make sure the validator settings
indicate XHTML rather than HTML.) In essence, these tools just run the document through a parser such as
xmllint to see whether it's error-free.
If you're using Firefox, you should install Chris Pederick's Web Developer plug-in
( https://addons.mozilla.org/firefox/60/ ). Once you've done that, you can validate any page by going to
Tools/Web Developer/Tools/Validate HTML. This loads the current page in the W3C validator. The plug-in also
provides a lot of other useful options in Firefox.
Whatever tool or technique you use to find the markup mistakes, validating is the first step to refactoring into
XHTML. Once you see what the problems are, you're halfway to fixing them.