W3C home > Mailing lists > Public > www-validator@w3.org > December 2010

Re: command line html validation

From: Ian Kent <ikent@companieshouse.gov.uk>
Date: Thu, 09 Dec 2010 09:49:58 +0000
Message-Id: <4D00A646.E6D9.00C5.0@companieshouse.gov.uk>
To: <www-validator@w3.org>, "Chelton Evans" <chelton.evans@yahoo.com>
Hi Chelton
I've been looking at exactly the same thing the last few days, and although I don't have a direct answer for you this might be useful - also worth pointing out I'm pretty new to this w3c validator stuff so can't guarantee the accuracy of my answers!
Firstly, there's an amended version of the W3C Validator script (from pre-emptive) which has been customised to look at local files, however it's a few versions out of date and as I've not used this I can't vouch for it.
In theory customising the existing validator to use local files shouldn't be difficult but its not something I've had time to look at yet. Perhaps command line/batch use is something which could be added to a future release of the W3C validator? It seems to be something a lot of users ask for.
Personally I chose to (temporarily) use the WDG Validator script:
Although not the W3C validator, it does already have support for command-line use with very straightforward syntax and seems to provide the same info as the W3C version. It also has far less dependencies than the W3C validator and thus far easier to install. Since it only requires the filename to check and outputs the results directly, I'm intending to use the WDG validator for now (to get the rest of my process working) and then write an interface to the W3C one which can replace the WDG version when (if) I have a bit of spare time on my hands.
Another alternative is to look at nsgmls or lq-nsgmls - although I don't know all that much about them, I gather they're SGML parsers with support for document validation and they're the ones apparently used by WDG Validator, perhaps these can output in a more usable format? I think lq-nsgmls also has specific HTML validation support.
Ian Kent

>>> On 09/12/2010 at 02:33, in message <105853.71588.qm@web38606.mail.mud.yahoo.com>, Chelton Evans <chelton.evans@yahoo.com> wrote:
While following validator.w3.org/docs/install.html I noticed set 4 had check with a url reference.  Is it possible to use the validator to look at local files. 

I am interested in parsing or getting the information before it is put into a html page.  Is there a way to generate xml data as an error/warning list.

Then could feed this to my tool chain or vim. In essence I would like to use the validator not as a web service but a text parser/xml tool. For example to batch process directories with many html files and generate reports.

kind regards
Chelton Evans


This message and any attachments are intended for the persons named as addressees only and may contain confidential information. In addition they may be protected by copyright. 

If you receive it in error, notify us, delete it and do not make use of or copy it. You must not copy, disseminate or otherwise distribute or publish this message, except for the purposes for which this message is intended, without our consent. 

Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We advise that you understand and accept this lack of security when e-mailing us.

For company information, guidance and how to file documents online,
please see our website www.companieshouse.gov.uk.

This message has been scanned for viruses by Hosted Security, a service from Websense.
Received on Thursday, 9 December 2010 09:53:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:02 UTC