[ Home |
Download |
Buy Now |
Support |
Search Local |
Search Online
]
[ Table of Contents ]
The HTML Validator Command Line Processor can be run from a DOS command prompt and will accept arguments passed to it from the command line.
NOTE: Since processing more than one file at a time using command line arguments is inefficient (unless you use the -f command), it is recommended that you use the drag and drop capability or the Batch Wizard to process multiple files. That is, drop the files to process onto the Drag and Drop Window of a running instance of HTML Validator. Use Windows Explorer to select the files to drop, and make sure that HTML Validator is set up to process the dropped files the way that you want (by validating and/or using a tool).
The file to run when using command line arguments is called "cmdlineprocessor.exe". This executable understands command line arguments and will call the validator engine (now in a DLL) to perform the correct job.
Examples of acceptable command lines include:
- "cmdlineprocessor.exe -l filename" - This causes HTML Validator to use the Lowercase Tool on the file specified by filename. Note that -l is the letter L and not the number one.
- "cmdlineprocessor.exe -u filename" - This causes HTML Validator to use the Uppercase Tool on the file specified by filename.
- "cmdlineprocessor.exe -s filename" - This causes HTML Validator to use the Strip HTML Tool on the file specified by filename.
- "cmdlineprocessor.exe -t filename" - This causes HTML Validator to use the Template Tool on the file specified by filename.
- "cmdlineprocessor.exe -c filename" - This causes HTML Validator to use the Convert Text File Format Tool on the file specified by filename. The format converted to is specified by the last saved program options.
- "cmdlineprocessor.exe -f filename" - This causes one instance of HTML Validator to efficiently execute multiple command lines. Each command line is specified on a single line in the text file specified by filename. In filename, cmdlineprocessor.exe is unncessary and should not be used. Comments are allowed in filename (New v6.50). If the first two non-space characters of a line are "//" (without the quotes), then the line is treated as a comment and is ignored. Using the -f method instead of calling cmdlineprocessor.exe once for each command may be much faster, depending on the specific commands. (New v3.00)
Example: Assume there are many documents that you want to use the template tool on (-t). Create a file called templatetool.txt that contains the following:
-t c:\htmlfiles\document1.html
-t "c:\htmlfiles\dir with space\document2.html"
-t c:\htmlfiles\document3.html
-t c:\htmlfiles\document4.html
Now process all the commands in templatetool.txt by calling cmdlineprocessor.exe -f templatetool.txt. The full path to cmdlineprocessor.exe and/or templatetool.txt may need to be used. Note that commands may also be mixed. The below would also be acceptable for templatetool.txt, although you may want to change the name of the file to a more general name like csecommands.txt:
// version 6.50 and above allows comments
// -if the first two non-space characters are "//", then the line is ignored
-v c:\htmlfiles\document1.html
// be sure to enclose the filename in double quotes if it contains any spaces
-t "c:\htmlfiles\dir with space\document2.html"
-l c:\htmlfiles\document3.html
-t c:\htmlfiles\document4.html
// the below line validates the file without the "-v" option (-v forces the viewer to open)
c:\htmlfiles\document5.html
// the below line causes the Batch Wizard to process the specified target list
-b c:\htmlfiles\batchwizard.lst
"cmdlineprocessor.exe -n windowname,messagenum,messageint" - This causes HTML Validator to send the message WM_USER+messagenum to the window named windowname. LPARAM will be messageint. (New v3.00)
- "cmdlineprocessor.exe filename" - This causes HTML Validator to validate the file specified by filename. HTML Validator may ask you if you want to open the viewer application with the results or may automatically open the viewer, depending on the program options.
- "cmdlineprocessor.exe -v filename" - This causes HTML Validator to validate the file specified by filename. -v forces the validator to open the results with the viewer, regardless of the program options. (New v3.00)
- "cmdlineprocessor.exe -b filename" - This causes the Batch Wizard to validate the targets in the target list specified by filename. The Batch Wizard does not automatically exit after processing. To exit after processing, use the cmdlineprocessor.exe -q command after using the cmdlineprocessor.exe -b command. If HTML Validator is already running when this command is issued, the already running instance will be used to validate the target list and a new instance will not be created. (New v4.0330)
- "cmdlineprocessor.exe -bx [filename]" - This causes the Batch Wizard to process the targets in the optional target list specified by filename. The tool to process the list with is specified by the x argument after -b (see the possible values for x below). The Batch Wizard does not automatically exit after processing. To exit after processing, use the cmdlineprocessor.exe -q command after using the cmdlineprocessor.exe -bx command. If HTML Validator is already running when this command is issued, the already running instance will be used to validate the target list and a new instance will not be created. If a filename is not specified, then this command can be used to select the tool to use in the Batch Wizard. (New v6.50)
Possible values for x in the expression -bx:
- 1 - Validate (the default)
- 2 - Uppercase (change tags to uppercase)
- 3 - Lowercase (change tags to lowercase)
- 4 - Strip (strip tags)
- 5 - Convert (convert file format)
- 6 - Template (process with the template tool)
- 7 - Link check (check links only)
- 8 - Spell check (spell check only)
- 9 - Quote (quote attribute values)
- "cmdlineprocessor.exe -o filename" - This causes HTML Validator to open the file specified by filename in the integrated editor. Multiple filenames separated by spaces are allowed. Filenames may be enclosed by quotation marks and should be if the filename contains space characters. (New v5.50)
- "cmdlineprocessor.exe -q" - If HTML Validator's editor is running, then this command sends a signal that causes it to exit. NOTE: Unsaved changes to documents, the configuration file, and the Batch Wizard target list will be lost if HTML Validator is closed in this manner. If the Batch Wizard is processing a target list, then HTML Validator will attempt to exit after the processing is complete. cmdlineprocessor.exe will return and the command will complete when HTML Validator's editor is closed. (New v6.50)
- "cmdlineprocessor.exe -1" - This causes the Validator Engine Options to be displayed. HTML Validator does not continue running when the Validator Engine Options are closed.
- "cmdlineprocessor.exe -2" - This causes the Configuration Editor to be displayed. HTML Validator does not continue running when the Configuration Editor is closed.
- "cmdlineprocessor.exe -3" - This causes the Batch Wizard Options to be displayed. HTML Validator will remain running when the Batch Wizard Options are closed. (New v4.04)
- "cmdlineprocessor.exe -4" - This causes the Editor Options to be displayed. HTML Validator will remain running when the Editor Options are closed. (New v4.04)
NOTE: The program options and configuration used to validate a document using a command line are those that are last saved and not necessarily those that are currently active if an instance of HTML Validator is running. This includes validating a document using an HTML Editor that provides integrated support for HTML Validator. If you've made changes to the options or configuration, then make sure that these changes have been saved before calling the validator on a command line.
Exit Codes
When cmdlineprocessor.exe exits, it returns one of the following values:
- 0 - no errors occurred in the cmdlineprocessor.exe portion of the command; however, it is possible an error occurred later
- 1 - a filename was given on the command line but the file does not exist
- 2 - miscellaneous error
- 3 - a filename is required for the command but none was given
- 4 - a timeout occurred waiting for HTML Validator's message window to become available; message could not be sent
- NOTE: Versions prior to v4.0330 will always return 0.
Special Notes
- If you are executing cmdlineprocessor.exe from a DOS prompt, then you must include the path to cmdlineprocessor.exe if the folder that contains cmdlineprocessor.exe is not in the search path, otherwise the system will not be able to find cmdlineprocessor.exe. However, you can type the command in the Start | Run dialog box without a path to the executable (in this case, use htmlval.exe instead of cmdlineprocessor.exe; the system will automatically translate htmlval.exe to the correct executable).
- If you are executing HTML Validator's editor from a DOS prompt, then you must include the path to cse70.exe if the folder that contains cse70.exe is not in the search path, otherwise the system will not be able to find the editor. However, you can type the command in the Start | Run dialog box without a path to the executable.
- When cmdlineprocessor.exe is run with command line arguments, cmdlineprocessor.exe performs the operation specified by the command line arguments and then immediately exits (unless otherwise noted above for the specific argument).
- Be sure to include the full path to filename if it is not in the current folder.
- Letters following '-' are not case sensitive. They may be either uppercase or lowercase such as -l or -L.
- When validating a file with cmdlineprocessor.exe, holding down the shift key will cause the page source to be opened in the viewer without validating it. This does not apply when -f is used and only works if the option to enable this functionality is checked in the Validator Engine Options (it is enabled by default). (New v7.00)
Opening Files in the Editor
To open a file in the editor, you can call cse70.exe followed by the filename. For example, "cse70.exe filename".
[ Table of Contents ]
Copyright © 1997-2005 AI Internet Solutions.