Download and Install the CSS Validator
Download the CSS Validator
Download the source
The CSS validator is available for download using CVS.
Follow the instructions to
access the W3C CVS public server and get 2002/css-validator. Note
that the online version of the CSS Validator is generally older than the CVS
version so results and appearance may vary slightly...
Download as java package (jar or war)
css-validator.jar
Installation guide
The CSS validation service is a servlet software, written in Java. It may be installed on any servlet engine,
and can also be used as a simple command-line tool.
The official W3C CSS Validation service is running with the Jigsaw server, which is the recommended setup.
However, for the sake of simplicity, we will, in this document, mostly provide details on how to install
it as an online servlet with Apache's servlet engine Tomcat.
Some instructions on installing the servlet with Jigsaw, as well as running it from a command-line environment,
are also given below.
Prerequisites
This installation guide assumes that you have downloaded, installed and tested:
- A working java environment,
- The Ant java building tool
- A java Web servlet container such as
Jigsaw, Tomcat or
Jetty if you plan on using the validator as an online service.
This guide only covers Tomcat and Jigsaw in details.
For the installation of the validator onto your system, you will
need to download and/or find in your system a number of java libraries:
- servlet.jar
(which, if you have Tomcat installed in [TOMCAT_DIR],
you should find in [TOMCAT_DIR]/common/lib/) possibly
under the name servlet-api.jar. If not, get it at
java.sun.com
- jigsaw.jar
- xercesImpl.jar and xml-apis.jar (which can be downloaded with
xerces-j-bin).
- tagsoup.jar
Install the CSS Validator with Tomcat
-
Download validator as explained above.
- Copy the whole source folder (".../css-validator/") to the webapps
directory within your installation of Tomcat. usually, this will be
[TOMCAT_DIR]/webapps/.
The Validator's sources are now in [TOMCAT_DIR]/webapps/css-validator,
which we will now call [VALIDATOR_DIR].
- In "[VALIDATOR_DIR]" create a directory "WEB-INF", and In "[VALIDATOR_DIR]/WEB-INF" create a directory "lib":
mkdir -p WEB-INF/lib
- Copy all the jar files (from the prerequisites) to the directory "[VALIDATOR_DIR]/WEB-INF/lib"
- Compile the validator's source: from the directory [VALIDATOR_DIR],
Run ant, while making sure that the jar files you downloaded are correctly set in you CLASSPATH environment variable.
Generally, the following will just work:
CLASSPATH=.:./WEB-INF/lib:$CLASSPATH ant
- Copy or move "[VALIDATOR_DIR]/css-validator.jar"
to "[VALIDATOR_DIR]/WEB-INF/lib/".
-
Copy or move file "web.xml" from
"[VALIDATOR_DIR]/" to
"[VALIDATOR_DIR]/WEB-INF/".
-
Finally, reload the Tomcat server:
"cd [TOMCAT_DIR]; ./bin/shutdown.sh; ./bin/startup.sh;"
Install on Jigsaw Web Server
- First, download the source as described above, get the necessary jars, and build the source with ant.
- Then you have to configure the validator home directory (usually this is
css-validator) so that it can work as a servlet container. For this purpose
you need to have Jigsaw installed (see the Jigsaw pages for a short
instruction (it is really easy)) and then start Jigsaw Admin. Change the
HTTPFrame to ServletDirectoryFrame.
- The next step is to create a resource "validator", with as class
'ServletWrapper' and as frame 'ServletWrapperFrame'. The latter should add
itself automagically. The class of the servlet is
org.w3c.css.servlet.CssValidator. If there already exists a file named
'validator', please rename it. It is important that this 'alias' is always
named 'validator'.
- Finally, start Jigsaw and run the validator. Check which HTML you want to
invoke. Usually your URL will look like this:
http://localhost:8001/css-validator/validator.html
Command-line usage
The CSS validator can also be used as a command-line tool, if your computer
has java installed. build the css-validator.jar as explained above, and run as:
java -jar css-validator.jar http://www.w3.org/