Boris Callens
Boris Callens

Reputation: 93397

Make html validation part of build cycle

Currently when I build my site I have to manually open validate it at the 3wbc site (means when opera pops up, press ctr+alt+shft+u) for every page. Is it possible to automatically validate every page whenever I build my pages?

P.s.: This page doesn't validate ;)

Upvotes: 1

Views: 475

Answers (3)

Jeffrey Fredrick
Jeffrey Fredrick

Reputation: 4503

Might not be best choice for you but there's an Ant task for this: XmlValidate.

Upvotes: 1

user42092
user42092

Reputation:

If you've got the HTML files in source control like SVN or Git, you can use a pre-commit hook script to run client-side validators on them. Or if you're feeling adventurous, you could use that method to ping another script on the server that validates the live pages...

Upvotes: 0

bobince
bobince

Reputation: 536715

You can download and install your own copy of the validator - http://validator.w3.org/source/ - and invoke it locally instead of trekking out to w3.org for each page. Still, this requires piggybacking over a web server through plain HTTP or the API. For a simpler solution you may prefer to download the SP library - http://www.jclark.com/sp/index.htm or http://openjade.sourceforge.net/ - on which the W3 validator is based, then invoke the command 'nsgmls' from the command line.

There are of course also many desktop HTML validators that can process a batch of HTML pages at once, which may not be automated, but would certainly be much easier than manually checking each page. For example http://arealvalidator.com/ (Windows), http://www.webthing.com/software/validator-lite/install.html (Unix).

Upvotes: 5

Related Questions