Total Validator
HTML / XHTML / WCAG / Section 508 / Links / Spelling

Help | Website | Feedback

Introduction

With the Pro desktop tool (except the OS X version) you can run from the command line rather than through the GUI. This may be used, for example, to run the tool automatically and unattended as part of an overnight check of your site.

An example Windows batch file for running the tool from the command line is provided called 'CommandLine.bat'. This may be found in the folder you installed the tool into (e.g. C:\Program Files\TotalValidatorTool). A shell script called 'commandline.sh' is provided for Linux platforms.

top

Command line options

The following options may be used when running from the command line. If no options are provided then it will attempt to use a default properties file

  • -help : displays the list of command line options and exits.
  • -properties Path_To_File : Where Path_To_File is properties file containing the command line options. If this option is used then it must be the only one used on the command line.
  • -interact : Will automatically launch a browser to display the results, and use interactive dialogs where there are problems with the options supplied. Don't use this option if you wish to run without any user interaction (any errors will be displayed on the command line).
  • -interactiveauth : If set (and -interact is set before this option) then display prompts when web/proxy authentication fails
  • -hideresults : Do not display the validation results in a browser. If you have -interact set then other interactive dialogs may still appear.
  • -file Path_To_File : Where Path_To_File is the starting web page located on local disk e.g. c:\mysite\index.html. If both this and -url are not supplied but -interact is used, then you will be prompted to choose a starting page on disk.
  • -url URL : Where URL is the starting web page e.g. http://mywebpage.com/index.html
  • -userobots : Skip paths specified in robots.txt
  • -skippath Path_To_Skip : where Path_To_Skip is a path within the starting URL to skip when testing more than one page (must start with a '/'). Regular expressions may be used, and you can use this option more than once.
  • -includepath Path_To_Include : where Path_To_Include is a path within the starting URL to include when testing more than one page (must start with a '/'). Regular expressions may be used, and you can use this option more than once.
  • -pages Pages : Where Pages is the number of pages to check. By default it will only check one page. Set this to zero to check all pages.
  • -depth Depth : Where Depth is the the directory depth below the starting page.
  • -showsuccess : Use this option to list pages that had no reported problems.
  • -dtd DTD : Where DTD represents the (X)HTML validation you wish to apply. See below for valid values.
  • -accessibility A|AA|AAA|A2|AA2|AAA2|508 : Supply one of the values A|AA|AAA|A2|AA2|AAA2|508 to represent the WAI or Section 508 validation you wish to apply.
  • -spellcheck GB|US|IT|FR|ES|DE : Supply one of the values GB|US|IT|FR|ES|DE to represent the language you wish to spell check with.
  • -altdic Path_To_File : Where Path_To_File is the path to a supplementary/alternative dictionary to use.
  • -uppercase : Spell check words that are all in upper case. Must appear after -spellcheck or -altdic
  • -mixedcase : Spell check words that are in mixed case. Must appear after -spellcheck or -altdic
  • -wordswithdigits : Spell check words with digits in. Must appear after -spellcheck or -altdic
  • -ignoresuggestions : When spell checking don't supply any alternative words when a word cannot be found in the dictionary. Must appear after -spellcheck or -altdic
  • -checkattrs : Spell check text in these attributes: alt, title, summary, label, prompt, standby. Must appear after -spellcheck or -altdic
  • -skiplangcheck : When spell checking don't check that the web page language is compatible with the spell check language.
  • -savebadwords : When spell checking save all the misspelt words to a dictionary.
  • -brokenlinks : Check for and report any broken links.
  • -followlinks : Will follow all links regardless of the starting page (Use with care).
  • -noquery : Will strip off query parameters from links before testing or following them.
  • -nosession : Will strip off session ids from links before testing or following them. e.g. http://yourdomain/page.html;session_id
  • -validateerrors : Validate error pages when HTTP error code is returned.
  • -timeout Seconds : If set after -brokenlinks, then Seconds is the time to wait before declaring a link broken. This must be a value between 10 and 120. It defaults to 20.
  • -concurrency Maximum : If set after -brokenlinks, then Maximum is the maximum number of links to check simultaneously. This must be a positive integer. Set to 0 to check all links simultaneously. It defaults to 10.
  • -reportredirects : If set after -brokenlinks, then all 301/302/303 redirection warnings will be reported.
  • -browser Browser : The browser you wish to display the results with. This defaults to the default browser. It should be the full browser's path for Linux or Windows.
  • -user UserName : Where UserName is required to access protected web pages.
  • -password Password : Where Password is required to access protected web pages.
  • -ignoreproxy : Ignore any operating system proxy settings e.g. those set in 'internet options' control panel applet in Windows.
  • -proxyhost Host : Where Host is the name of the proxy server you need to go through to access the starting web page.
  • -proxyport Port : Where Port is the port the proxy server listens on. This must be an integer in the range (1-65535).
  • -puser UserName : Where UserName is required to traverse an authenticating proxy server.
  • -ppassword Password : Where Password is required to traverse an authenticating proxy server.
  • -showwarnings : Show warnings as well as errors in the results.
  • -hidecontent : Hides the content on the report
  • -ENNN : Where NNN is the number of an error to suppress on the report. You can use the -E option as many times as you wish on the command line for each error you wish to suppress.
  • -WNNN : Where NNN is the number of a warning to suppress on the report. You can use the -W option as many times as you wish on the command line for each warning you wish to suppress.
  • -identity identity : Where identity is the name of a user agent in the identity.props file.
  • -cookiepolicy ACCEPT_ALL|ACCEPT_NONE|ACCEPT_SESSION|ACCEPT_SERVER : Use this option to specify how you wish to deal with cookies received whilst validating. Defaults to ACCEPT_SERVER.
  • -cachepolicy CACHE_ALL|CACHE_PERMANENT|CACHE_NONE : Use this option to specify which cookies received during validation you wish to cache to disk. Defaults to CACHE_PERMANENT.
  • -sendpolicy SEND_ALL|SEND_PERMANENT|SEND_NONE : Use this option to specify which cookies to send from the disk cache. Defaults to SEND_PERMANENT.
  • -cookieX Cookie : Where Cookie is a standard set-cookie HTTP header. This cookie will be treated like a normal cookie received from the server for the starting page and subject to the policies defined above. X is a number greater than zero to allow more than one cookie to be passed.
  • -shortreport : Display a short form of the report.
  • -uniquereport : Output the results using a unique report name.
  • -resultsfolder Path_To_Folder : Where Path_To_Folder is the folder you wish to store the results in. This defaults to the folder you installed the tool into.
  • -showresultspath : Output to stdout the path to the results file.
  • -stdout : Output the results file to stdout. Only works if a single page is being validated.
  • -extendedstatus : Output an exit status of 4 if any validation errors, 2 if any validation warnings, 6 if both, 0 if none, 1 if there are program errors.
  • -action Action : Where Action is the value of the 'action' attribute value to match for form submission.
  • -actionregex : Treat the -action option as a regular expression
  • -submit Name : Where Name is the name of the submit button to use if there is more than one.
  • -nameX Name : Where Name is the name of a parameter to submit when sending a form, and X is a number greater than zero. e.g. -name3 userid.
  • -valueX Value : Where Value is the parameter value to submit when sending a form, and X is a number greater than zero corresponding to a -nameX option. e.g. -value3 julie.

Valid values for use with the -dtd option above are listed below. Note that these are case-sensitive:

  • Auto-detect
  • Best-fit
  • "HTML5"
  • "XHTML5"
  • "XHTML+RDFa 1.1"
  • "XHTML+RDFa 1.0"
  • "HTML4+RDFa 1.1"
  • "HTML4+RDFa 1.0"
  • "XHTML 1.1"
  • "XHTML Basic 1.1"
  • "XHTML 1.0 Strict"
  • "XHTML 1.0 Transitional"
  • "XHTML 1.0 Frameset"
  • "XHTML-Print 1.0"
  • "XHTML Basic 1.0"
  • "ISO/IEC 15445:2000"
  • "HTML 4.01 Strict"
  • "HTML 4.01 Transitional"
  • "HTML 4.01 Frameset"
  • "HTML 4.0 Strict"
  • "HTML 4.0 Transitional"
  • "HTML 4.0 Frameset"
  • "HTML 3.2"
  • "HTML 2.0"

top

Properties file

In place of a long command line with lots of options as described above, you can place all these options into a properties file instead, and then just use the single -properties option to refer to this file

Here's an example properties file to help. Note that comments are prefixed with a #, and that each option must be on it's own line. Blank lines are ignored.

If no command line options are provided then then it will look for a file called commandline.props in the <data>/TotalValidatorTool folder:

  • For Vista/Windows7 the <data> folder is <user_home>\AppData\Roaming\TotalValidatorTool
  • For Windows 2K/XP the <data> folder is <user_home>\Application Data\TotalValidatorTool
  • For Linux the <data> folder is <user_home>/.totalvalidatortool

top

Examples

As an example the following line will silently check all the pages on a website for compliance against XHTML 1.1, with W3C WCAG v1 AAA accessibility, spell checked against the British dictionary, also checking for broken links:

TotalValidatorCL.exe -url http://www.your_web_site.com/index.html -pages 0 -dtd "XHTML 1.1" -accessibility AAA -spellcheck GB -brokenlinks

The following example prompts for a single local web page, then check it for compliance against HTML 4.01, with Section 508 accessibility, spell checked against a user-supplied dictionary, and automatically displaying the results in a browser at the end:

TotalValidatorCL.exe -interact -dtd "HTML 4.01 Transitional" -accessibility 508 -altdic c:\mydic.txt

The next example tests a local web site for broken links, reports all redirects, but suppresses the reporting of 302 and 303 warnings, and automatically shows the results:

TotalValidatorCL.exe -interact -pages 0 -file c:\mysite\index.html -brokenlinks -reportredirects -W302 -W303

To supply the command line options in the default commandline.props properties file, simply use:

TotalValidatorCL.exe

To supply the command line options in your own properties file, use:

TotalValidatorCL.exe -properties myprops.props

top