Source

vnu / README.markdown

Michael[tm] Smit… 63f15f8 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 63f15f8 























































Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 







Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 









Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 




Michael[tm] Smit… 3d58253 
Michael[tm] Smit… 67abf5b 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 2a17af6 
Michael[tm] Smit… 628dd06 

Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 9b32505 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 628dd06 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 628dd06 
Michael[tm] Smit… f8e32ab 

Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 628dd06 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 2a17af6 
Michael[tm] Smit… 628dd06 
Michael[tm] Smit… 2a17af6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 628dd06 
Michael[tm] Smit… f8e32ab 




Michael[tm] Smit… 628dd06 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 628dd06 
Michael[tm] Smit… f8e32ab 


Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 67abf5b 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 628dd06 


Michael[tm] Smit… f8e32ab 



Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
Michael[tm] Smit… 9ec68e6 
Michael[tm] Smit… f8e32ab 
There are two ways you can use the code here to validate documents:

* Download, build, and run the validator from the sources; or
* Use the pre-built `vnu.jar` and `vnu-fast-client.jar` files
  
For information on using using the `vnu.jar` and `vnu-fast-client.jar`
files, see the *Pre-built jars* section below.

## How to download, build, and run the validator from the sources

First, set the JAVA_HOME environment variable properly.

On Ubuntu:

    export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

On Mac OS X:

    export JAVA_HTML=/Library/Java/Home

Next, create a validator workspace.

    mkdir checker
    cd checker
    hg clone https://bitbucket.org/validator/build build

The above steps create a `checker` directory in which the build script will
create other subdirectories, and downloads the `build.py` script itself
into a `build` subdirectory in your `checker` directory.

Finally, run the build script.

    python build/build.py all
    python build/build.py all

Yes, the last line is there twice intentionally. Running the script twice tends
to fix a `ClassCastException` on the first run.

The above steps will download, build and run the system at `http://localhost:8888/`.
For other options, please run `python build/build.py --help` instead.

Please note that the dependencies are big. The script will spend time
downloading stuff. The script requires Python, Mercurial, Subversion and JDK 5
or later (JDK 6 and Hardys OpenJDK work). (Tested on Mac OS X and Ubuntu with
the openjdk-6-jdk package.)

Note: The script wants to see a Sun-compatible jar executable. Debian fastjar
will not work.

## Deployment

The above example starts a standalone HTTP server with debug messages printed to
the console. To use AJP13 instead, use `--ajp=on`. A log4j configuration for
deployment can be given using the `--log4j=` option. There is a sample file in
`validator/log4j-deployment-sample.properties`. The directory `extras/` is
searched for additional jars for the classpath. For example, if you configure
log4j to send email, you should put the Java Mail API and JavaBeans Activation
Framework jars in extras/.

You can validate a single document by doing this:

    java -jar vnu.jar FILE.html

You can batch-validate multiple files at once by doing this:

    java -jar vnu.jar FILE.html FILE2.html FILE3.HTML FILE4.html...

Or by doing something like this:

    java -jar vnu.jar $(find . -name "*.html")

### Faster validation

For faster validation -- especially for single files -- you should run the
validator as a service and use `vnu-fast-client.jar`.

To do that, you first need to start the validator by doing this:

    java -cp vnu.jar nu.validator.servlet.Main 8888

(To have the validator listen on a different port, replace `8888` with the
port number.)

The validator will run in the console window in which you start it, writing
any service messages to that window.

In a separate console window, you can validate a single document by doing
this:

    java -jar vnu-fast-client.jar FILE.html

You can batch-validate multiple files at once by doing this:

    java -jar vnu-fast-client.jar FILE.html FILE2.html FILE3.HTML...

Or by doing something like this:

    java -jar vnu-fast-client.jar $(find . -name "*.html")

### Configuration

You can configure the validator behavior using Java system properties.
These properties map to the Validator.nu common input parameters documented
at
[http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters][1].

   [1]: [http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters]

#### nu.validator.client.host

    Specifies the hostname of the validator for the client to connect to.

    default: 127.0.0.1

#### nu.validator.client.port

    Specifies the hostname of the validator for the client to connect to.

    default: 8888

    example: java -Dnu.validator.client.port=8080 -jar vnu.jar FILE.html

#### nu.validator.client.level

    Specifies the severity level of validation messages to report; to
    suppress warning-level messages, set this to error.

    default: [unset]

    possible values: error

    example: java -Dnu.validator.client.level=error -jar vnu.jar FILE.html

#### nu.validator.client.parser

    Specifies which parser to use.

    default: html or (for *.xhtml files) xml

    possible values: see [http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#parser][2]

   [2]: [http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#parser]

    example: java -Dnu.validator.client.level=error -jar vnu.jar FILE.html

#### nu.validator.client.charset

    Specifies the encoding of the input document.

    default: [unset]

### nu.validator.client.content-type

    Specifies the content-type of the input document.

    default: text/html or (for *.xhtml files) application/xhtml+xml

### nu.validator.client.out

    Specifies the output format for validation messages.

    default: gnu

    possible values: see [http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#out][3]

   [3][http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#out]

### nu.validator.client.asciiquotes

    Specifies whether ASCII quotation marks are substituted for Unicode
    smart quoation marks in validation messages.

    default: yes

    possible values: yes or no
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.