deutsch
W3C Validator offline
Installation
- Installing the msi version of Apache2 was not really difficult. Strangely enough though, this server offers [...]\Apache Group\Apache2 as the standard installation path. If you install Windows ports of Linux applications it is a good idea not to use folder names containing spaces. We therefore chose our path to be C:\Web\Apache2.
- ActivePerl is also available as an easy-to-install msi file. We recommend letting the installer include the path to perl.exe into the PATH environment variable. It will make adapting and testing Perl scripts easier. The downloaded package lacks a few modules that are needed by the Perl script of the validator. We will come back to that later. Our installation ended up in C:\Web\Apache2\Perl.
- The SGML parser only needs unzipping. Our destination: C:\Web\Apache2\OpenSP15.
- Both the W3C validator and its DTD's can be downloaded as tar.gz files. As far as we could check them they are identical to the versions online. (These lines were written in January 2005). Our validator was installed into C:\Web\Apache2\validator
Fine Tuning
- The httpd.conf in the conf folder of Apache2 has to be adapted to your local installation. We will only touch the lines concerning the validator here. (Hint: your server must support CGI and SSI). We found some good tips at Scottish Lass; her advice and the httpd.conf found in httpd\conf in the validator folder helped us set up the following:

Of course, there is a listing to copy and paste the settings from.
- ActivePerl has to be updated with a few modules by using its package manager ppm. Before you do so you should rename the Perl script in validator\httpd\cgi-bin from check (without file extension) into check.pl and change the first line of the script into
#!perl -w
After that you can call the script in a DOS box by typing (including our example path)
perl C:\Web\Apache2\validator\httpd\cgi-bin\check.pl
The script gets as far as to the first missing module and produces an error message including the module's name. This can now be installed via ppm. (In ActivePerl's help you will find good instructions on how to use ppm) Having installed the module you can call the script anew, get to the next error message, aso.
Some modules are not available from the servers of ActiveState. Blechtrottel brodaktschns found them in the repository of the University of Winnipeg and included it into ppm (http://theoryx5.uwinnipeg.ca/ppms/). How you search and include your own ressources is described in ActiveState's help. If all that does not help you and you still need some modules, try searching the internet or get assistance from a Perl expert.
- Getting a Windows version of OpenSP, the SGML parser is a bit tricky. If you search the project's official web pages, you will most probably not find it. If a web search for Höhrmann and OpenSP does not yield results, you can use its predecessor SP. (Even though development stopped quite a while ago the validator works fine with SP.) The tar.gz only needs unpacking with full paths. In any case, the validation libraries (DTD's) should be replaced with the newest package form the W3C.
- Last but not least let us deal with the validator itself. In htdocs\config there is a file called validator.conf, in which the paths to several cfg files have to be adapted. Note: You have to use forward slashes in the paths, e.g.:
file://C:/Web/Apache2/validator/htdocs/config/eref.cfg
The third slash found in the default validator.conf after file:// is part of the Unix path, so for Windows use only two (s. above)!
There are a few obstacles within the script that have to be tackled when you want to use it under Windows. It needs some Perl tuning. In line 100 the validator has to find its configuration file:
$CFG = &read_cfg('C:/Web/Apache2/validator/
htdocs/config/validator.conf');
(Again without line break originally) Lines 613ff prepare the call of the SGML parser. The option -R which is used there is not supported by the parser. This line (614) should therefore be deleted.
In line 752 the script uses a regular expression to search for a capital C in the output returned by the parser. The expression used is /^C$/, which reads as: a capital C directly after the start of a line and just before the end of the line. In Windows/DOS this capital C is followed by a line break (CR, LF), therefore the expression has to be changed to /^C\s*$/ in order to have the desired effect.
Beginning with line 1692 the script takes out that part of the parser's output which is relevant for the page displaying the validation results. The parser separates its output by colons; consequently the script splits the lines in question at the colons. These lines also include the name of the file validated including its full path. Since every path in Windows, other than in Linux, includes a colon after the drive letter, the line is split into one segment too many, which makes the script fail. It is wise to replace the colon after the drive letter by some other character. This is what we included as an extra line 1705 here at blechtrottel brodaktschns:
s,:(\\|/),-$1,g;
Basically it would be possible to set the path right again by changing the - back into : . As the script does not use the path again, we refrained from doing so. You could also put the path together again to set things right and avoid replacing the colon in the first place, but we took the quick and dirty approach. If you are a Perl pro go for it :-)
nextPart1 - Part2 - Part3