iCab (http://www.icab.de/) is a web browser in
development for MacOS 8.6 or higher. It aspires to support
many current and upcoming standards for web browser, and
includes a built-in validator to help authors understand
when their pages do not conform to the HTML standard.
To use iCab to check the syntax of a web page, simply
open the page for viewing as you would with any other file
or URL. Here's a sample web page as viewed using iCab:
Note the purple unhappy face (
). If the page didn't contain any
syntax errors, a happy face (
) would be displayed. If the page
did not contained errors but contained any warnings, a
cautious face (
) would be displayed.
When you click on the unhappy face, an error report like
the following is displayed:
The line numbers on the left correspond to the line in
the HTML document as it was transferred by the web server.
If your web page uses server side includes, view the source
of the document from within iCab by double-clicking on the
line number.
If you're fixing the errors with BBedit, you'll want to
turn on line numbering, so that you can find the errors
reported by BBedit. To do so, click on the third icon from
the left (
) at the top of
the document window. Use the same icon to make sure soft
wrapping of the text is off. The window will look soemthing
like the image below.
For simpler pages, the process is now as simple as
matching up the line numbers reported by iCab with the line
numbers in BBedit. If you've used server side includes in
your pages, the line numbers displayed won't always match
up with the line numbers reported in iCab's error report.
In those cases, view the source from within iCab (see
above), then figure out where the error is relative to the
code you're looking at in BBedit.
BBEdit also has a built-in syntax checker. To validate
an HTML document using BBedit, click the "Check Syntax"
button on the HTML Tools Palette.
The window below is an example of the syntax checker.
The number of errors are at the top of the window and each
error is listed in the top half window. If you click on the
error it will come up in the lower part of the window
highlighted.