W3CValidation

Command line W3C Validator 1.0

The Command Line W3C Validator is a modified version of the very useful online W3C 32 Validator. The intention was to produce a version of the validator that did not require a web server to use it. Indeed, no additional software is required (besides pre-requisites such as Perl).

The use of the command line rather than CGI/mod_perl access means that HTML files can be checked quickly, and possibly in bulk. Also, because it is command line it can be integrated into other applications.

(See attached file, readme.txt for more information)

Using the Command Line Validator

To use the validator, download a version of it. For fastest startup, download the complete package. If you already have the SGML libraries from W3C, then you can download the version without DTDs. I have additionally included a download for the original HTML documents that were included with the CGI version, but these are not used for the command line version (although include important information, such as licensing).

If you download the full version, simply extract the tar file to a directory (it will create a "w3cvalidator" subdirectory). Inside there you will find a "bin" directory containing the "check" program. Run this in accordance with the usage notes (see attached file)

If you already have the SGML libraries, then you can save a bit of downloading time and use the no-dtd version. Follow the same procedure as above, but copy the sgml-lib directory from the tar file from the W3C into the etc directory.

Integration With Other Applications

To use the command line program within other applications, there are two "modes" of operation. The first is to simply run the check program with whatever arguments you require. This works fine, but involves a lot of Perl compilation and subsequent reading of configuration files, so is quite slow and resource hungry.

Alternatively, specify a dash ("-") as the file to validate and check will drop into a sort-of interactive mode. Here you can just enter the same arguments as you would have done on the command line; check will operate the same way, but only compiles the perl and reads configuration once.

For more information, see the usage notes (see attached file).

For more elaborate integration, one might want to have links to documentation about the HTML standards (so that a user could look up an error message, for example). This isn't immediately easy with the command line program, but can be achieved in a number of ways. Most probably, the output of the check program could be "interpreted"; each error message is then looked up in a database and the location of the documentation is found. This would require knowledge of all possible error and warning messages though (which I don't have ;-)

Downloads - see attached files.

Future Plans

I intend to do a proper job of maintaining this application one day. If you're keen to take over, let me know ;-) Update: Wiki-fiying is the start of that

AttachmentSize
readme.txt1.34 KB
usage.txt2.59 KB
w3cvalidator.tar.gz2.55 MB
w3cvalidator-htdocs.tar.gz101.95 KB
w3cvalidator-nodtd.tar.gz20.18 KB
Submitted by coofercat on Mon, 2004-07-26 22:39