Re: off line version

On 26-May-08, at 1:46 AM, Gabor Szabo wrote:
> Thanks, that I can install on my machine but it still provides only a
> web interface.

Actually the perl CGI module is very cool, it allows you to call the  
script from the command line too.

First, maake sure that the environment variables are set (not needed  
if you installed the config files in /etc/w3c )

$ export W3C_VALIDATOR_CFG=path/to/validator/htdocs/config/validator- 
$ cd path/to/validator/httpd/cgi-bin

$ ./check uri=
... will give you the html output. Not bad, but a bit verbose.

One trick is to grep for the custom HTTP headers the validator sends

$ ./check uri= | grep X-W3C-Validator
X-W3C-Validator-Recursion: 1
X-W3C-Validator-Status: Invalid
X-W3C-Validator-Errors: 1
X-W3C-Validator-Warnings: 2

Or you can also use one of the alternate outputs, which tend to be  
more terse.

$ ./check uri= output=n3

> Is there a version that provide a command line interface or an API
> that I can call
> and get back if the page is valid or not?

There's a web services API:


Received on Thursday, 29 May 2008 16:50:37 UTC