[ Home |
Download |
Order |
Support
]
[ Table of Contents ]
Configuration Program Editor
This editor is available from the Programs tab of the Configuration Editor.
The Programs tab in the Configuration Editor allows you to view and edit the tag name programs that are associated with the currently selected tag name being configured. The program for a tag name is executed each time the tag name is used (or closed) in a document that is being validated. These programs are also called tag name programs because they are generally run when a certain tag name is encountered in a document that is being validated.
Radio Button
- Edit Program Type - Use these radio buttons to select the program to edit. Open tag name programs are run when tags are opened in HTML documents. End tag name programs are run when tags are ended/closed in HTML documents (New v4.00). When editing an open or end tag name program, you must specify for which tag the program belongs to by selecting a tag from the Tag Name Being Configured List Box. Text programs are run when text is encountered that is not in a tag. The start validation program is run just prior to beginning to validate the HTML document and the end validation program is run at the end of the validation after all tag name and text programs have run (New v3.02).
Options
- Enable open program for tag - Check this box to enable the open tag name program for the tag name being configured. This option is not enabled by default.
- Enable end program for tag - Check this box to enable the end tag name program for the tag name being configured. This option is not enabled by default.
- Enable attribute program - Check this box to enable the attribute program for the attribute being configured. This option is not enabled by default.
The Tag Name Program Programming Language
Quick jump to function:
General Information
- Function and procedure names are case insensitive.
- Integer expressions are computed from left to right, without regard to operator precedence.
- Comments can be included in the program by beginning them with "/*" and ending them with "*/". For example: /* This is a comment */
Variable/Symbol Names
- are not case sensitive
- must be alphanumeric
- must begin with an alphabetic character
- setting variables in integer and string expressions is possible
- To access a variable, use $name. The return value is a string if name is accessed in a string expression, or an integer if name is accessed in an integer expression. #name can also be used in an integer expression.
- To increment an integer variable by one in an expression, use $name++, to decrement by one, use $name--. To increment an integer variable by one using a statement, use $name++;, to decrement by one, use $name--;. Note that using # instead of $ is also valid.
$name=string exp value;
Creates a variable called name (if it doesn't already exist), and sets its value to value. The return value is value and is a string.
#name=int exp value;
Creates a variable called name (if it doesn't already exist), and sets its value to value. The return value is value and is an integer.
Data Types
- int - an integer such as -7, 0, 89, etc.
- int exp - an expression that evaluates to an integer such as -7, 0, 89, 5+3, 56-34, 3*2, 6*(7-3), etc.; variable names and functions returning an int can be used
- !int1 : returns 1 if int1 is 0, else returns 0
- int1 + int2 : returns the sum of int1 and int2 (int1+int2)
- int1 - int2 : returns int1-int2
- int1 * int2 : returns int1*int2
- int1 / int2 : returns int1/int2; generates an error if int2 is 0 (New v4.5033)
- int1 & int2 : returns the bitwise AND of int1 and int2
- int1 | int2 : returns the bitwise OR of int1 and int2
- int1 == int2 : returns 1 if int1 and int2 are equal, else returns 0; note the double equal signs
- int1 && int2 : returns 1 if int1 and int2 are both nonzero, else returns 0
- int1 || int2 : returns 1 if either or both int1 and int2 are nonzero, else returns 0
- int1 >= int2 : returns 1 if int1 is greater than or equal to int2, else returns 0
- int1 <= int2 : returns 1 if int1 is less than or equal to int2, else returns 0
- int1 > int2 : returns 1 if int1 is greater than int2, else returns 0
- int1 < int2 : returns 1 if int1 is less than int2, else returns 0
- int1 <> int2 : returns 1 if int1 does not equal int2, else returns 0
- int1 != int2 : returns 1 if int1 does not equal int2, else returns 0
- float exp - similar to an int expression but with floating point numbers instead of integers; should not be of much use for tag name programs
- string exp : an expression that evaluates to a string
- constant strings can be enclosed in double quotes (") or single quotes ('), such as "This is a string" or 'This is also a string'
- string1 + string2 : concatenates string1 and string2, returns string1string2
Flow Control
do { statement; ... } while (int exp);
Executes a statement or statement block while the integer expression is true (nonzero). The statement or statement block is executed at least once.
if (int exp) { statement; ... } [else { statement; ... }]
Executes a statement block, depending on the value of the integer expression. Executes the statement block following if if the integer expression is nonzero, else executes the statement block following else if the integer expression is 0. The else part is optional.
for (statement1; int exp; statement2) { statement3; ... }
Executes statement1, then evaluates the integer expression. If the integer expression is nonzero, then statement3 is executed, otherwise control returns to the statement immediately following the block that contains statement3. If the statement3 block is executed, statement2 is executed immediately afterwards. The integer expression is then reevaluated and the loop continues until the integer expression evaluates to zero. statement1 and statement2 may be statement blocks.
For example, this loop continues while the integer expression is nonzero: execute statement1, evaluate integer expression, execute statement3 block, execute statement2, evaluate integer expression, execute statement3 block, execute statement2, evaluate integer expression, ...
while (int exp) { statement; ... }
Continues executing a statement block while the integer expression is true (nonzero).
Functions
Simple, user-defined functions are new to CSE HTML Validator Professional v4.0320 and later. To define a function, add a function to the functions program type in the following format (note that the keyword function must begin at the first character of a line):
function functionname() { statement; ... }
To call a function, use @functionname();.
Special Functions
- onConfigLoad() - run when a configuration is loaded; can be used to add validation modes that the configuration supports (New v4.5091)
Functions Returning Integers
int checkString(int exp flags, string exp string)
- flags - can be added together
- 1 - returns TRUE if string has leading space characters
- 2 - returns TRUE if string has ending space characters
- 4 - returns TRUE if string appears to be an absolute URL missing a protocol; v4.50 replaces entities and URL decodes before checking
- 8 - returns TRUE if string begins with a letter (A-Z or a-z) and consists of the following characters: (A-Z), (a-z), (0-9), hyphens (-), underscores (_), colons (:), or periods (.)
- 16 - returns TRUE if string begins with a letter (A-Z or a-z)
- 32 - returns TRUE if string contains any collapsed PHP, ASP, etc. code. (looks for strings like PHP, ASP, and MIVA in string and returns TRUE if it finds it) (New v4.0330)
- 64 - returns TRUE if string ends in a '#' character (not considering trailing spaces) and string does not contain more than one '#' character (New v4.0410)
- 128 - returns TRUE if string contains a '#' character that is surrounded by one or more spaces and string does not contain more than one '#' character (New v4.0410)
- 256 - returns TRUE if string appears to be an internal link (starts with the character '#' and does not contain more than one '#' character) (New v4.0410)
- 512 - returns TRUE if string appears to be a valid email address (ignores the '?' character and everything after it); as of v6.01, if returning FALSE, then sets $checkstring512details with details about the incorrect syntax; as of v6.01, works with multiple email addresses separated by commas NOTE: Always returns TRUE if email address syntax checking has been disabled. (New v4.05)
- 1024 - use with 512; ignores any "mailto:" prefix in string when checking for a valid email address (New v4.05)
- 2048 - returns TRUE if the string contains any spaces (New v4.5000)
- 4096 - returns TRUE if a '%' character is found that is not followed by two hexadecimal digits (New v4.5000)
- 8192 - returns TRUE if the string consists only of lowercase characters, numbers, backslashes, and underscore characters, and has a maximum of one colon and one period (New v4.5021)
- 16384 - returns TRUE if the string consists only of lowercase characters, numbers, and underscore characters, and has a maximum of one period (New v4.5022)
- 32768 - returns the number of possible misspellings in string and adds the possibly misspelled words to the list of possibly misspelled words (New v4.5091)
- string - the string to check
- The default return value is 0 unless it is changed due to a flag.
- This function is implemented only in CSE HTML Validator v4.0320 and later.
int checkStringEx(int exp flags, int exp mode, string exp string)
- flags - can be added together
- flags - the flags value depends on mode so see the values for mode below for available flags; if a mode does not say anything about flags, then the flags value is not used and should be 0.
- mode - can not be added together
- 1 - return TRUE if string is a valid charset like "iso-8859-1".
- 2 - return TRUE if string ends with a comma (disregarding trailing whitespace). (New v5.0200)
- 3 - return TRUE if string appears to be a valid "lang" attribute value. (New v5.4910)
- 4 - return TRUE if string begins with a # character (disregards preceding whitespace). (New v5.4910)
- 5 - return TRUE if string contains two or more adjacent hyphens (use for checking comments; excludes beginning !-- and ending --, returns FALSE if string begins with !--#). (New v5.4910)
- 6 - return TRUE if string ends in "--" followed by one or more spaces. (New v5.4910)
- 7 - return the number of words in string (New v5.4930)
- 8 - return the number of repeated words/phrases given a comma separated list in string; a list of repeated words/phrases is stored in $repeatedlist; the number of "empty" words is stored in $numemptywords (New v5.4940)
- 9 - returns TRUE if string is a percent, else returns FALSE (New v5.4940)
- 10 - returns TRUE if string contains only digits 0-9 (must contain at least one digit), else returns FALSE; flags below (New v5.5100)
- 1 - allow leading whitespace
- 2 - allow trailing whitespace
- 4 - allow an optional preceeding '-' character
- 8 - require preceeding '-' character
- 16 - allow zero or one '.' characters
- 32 - require one '.' character
- 64 - allow an optional ending '%' character
- 128 - require ending '%' character
- 256 - instead of returning TRUE or FALSE, return one of following values
- >=0 - value is OK
- <0 - value is NOT OK
- 1 - value is a percent >100% (only if flag 512 set)
- -1 - miscellaneous reason why value is not OK
- -2 - misplaced or multiple '-' characters
- -3 - multiple '.' characters
- -4 - missing required '-' character
- -5 - missing required '.' character
- -6 - missing required '%' character
- -7 - contains unallowed character or bad format
- -8 - contains no digits (must contain at least 1)
- 512 - use with flag 256 to allow a return value of 1
- 11 - returns TRUE if string contains only whitespace characters (one or more), else returns FALSE (New v5.9910)
- 12 - returns TRUE if string is an index page (such as "index.htm", "index.html", "index.php", "index.asp") or if the string ends in a "/" followed by an index page, else returns FALSE (New v5.9910)
- 1 - if returning TRUE, create variables $checkstringex12docname (contains "index.htm", "index.php", etc) and $checkstringex12recommendedurl (contains the recommended replacement URL)
- string - the string to check
- The default return value is 0 (FALSE) unless it is changed due to a valid mode.
- This function is implemented only in CSE HTML Validator v4.9910 and later.
int checkVersion(float exp version)
- version - the minimum version of the validator required for the function to return 1
- Returns 1 if using HTML Validator version version or greater, else the function returns 0.
- Use this to help make sure that the procedures and functions that are being used are valid for the version of HTML Validator that is executing them.
int getAttIndex(string exp attribute)
- attribute - the attribute in the tag to search for
- Returns the index of the attribute. If the attribute does not exist, the function returns 0. For example, if the attribute exists and is the first attribute for the tag, the function returns 1.
int getNumAttributes()
- Returns the number of attributes for the current tag.
int getStringStartIndex(string exp string1, string exp string2)
- Searches for string2 in string1 and returns the index into string1 where string2 starts.
- The index is 0 based. For example, if string2 is contained in the very beginning of string1, then the function returns 0.
- If string2 is not in string1, then the function returns -1.
- Performs a case insensitive search.
- This function is implemented only in CSE HTML Validator v3.03 and later.
int getValueInt(int exp valueidentifier)
- valueidentifier - tells the function which value to return
- 1 - the current number of error messages in the display queue
- 2 - the current number of warning messages in the display queue
- 3 - the current number of message messages in the display queue
- 4 - the current number of comment messages in the display queue
- 5 - returns 1 if compiled for a "normal" build (not an OEM version), else returns another value
- 6 - returns 1 if running from command line arguments, else returns 0
- 7 - returns 1 if processing a batch (for example, called with -f), else returns 0
- 8 - returns the number of lines in the document (New v4.00)
- 9 - returns the number of elements (tags) in the document (New v4.00)
- 10 - returns the number of elements (tags) that have been closed (New v4.00)
- 11 - returns the number of HTML comments in the document (New v4.00)
- 12 - returns the number of entities in the document (New v4.00)
- 13 - returns the number of tag name programs run (New v4.00)
- 14 - returns 1 if the validator is generating an easily parsed output file (usually used when integrating with other applications), else returns 0 (New v4.00)
- 15 - returns 1 if the validator is validating a file in CSE's integrated editor (not in classic mode), else returns 0 (New v4.00)
- 16 - returns 1 if the validator is validating a file in CSE's integrated editor (whether in classic mode or not), else returns 0 (New v4.00)
- 17 - returns the number of bytes in the document (each newline is considered 1.5 bytes) (New v4.0012)
- 18 - returns 1 if the validator is validating a file in CSE's Batch Wizard, else returns 0 (New v4.02)
- 19 - returns 1 if there have been too many errors or warnings and CSE is terminating the validation (New v4.5021)
- 20 - returns CSEJOBSUBTYPE (New v4.5091)
- 21 - returns the attribute index for attribute programs or attribute value programs (should be >=1)(New v4.5091)
- 22 - returns doctypeflags (contains information about the DOCTYPE being used) (New v4.5110)
- 1 - DOCTYPE is empty string
- 2 - DOCTYPE contains "strict" (case insensitive)
- 4 - DOCTYPE contains "transitional" (case insensitive)
- 8 - DOCTYPE contains "frameset" (case insensitive)
- 16 - DOCTYPE contains "HTML 4.0" or "HTML 4.01" (case insensitive)
- 32 - DOCTYPE contains "XHTML" (case insensitive)
- 64 - DOCTYPE contains "XHTML 1.1" (case insensitive) (New v5.0200)
- 128 - DOCTYPE contains "XHTML 1.0" (case insensitive) (New v5.0200)
- 256 - DOCTYPE contains "HTML" (case insensitive) (New v5.4910)
- 512 - DOCTYPE contains "XHTML Basic" (case insensitive) (New v5.4920)
- 1024 - Document has no DOCTYPE (or the DOCTYPE hasn't been set/encountered yet) (New v5.4930)
- 2048 - DOCTYPE contains "HTML 3.2" (case insensitive) (New v5.9910)
- 4096 - DOCTYPE contains "HTML 3.0" (case insensitive) (New v5.9910)
- 8192 - DOCTYPE contains "HTML 2.0" (case insensitive) (New v5.9910)
- Only one or none of the following flags will be set: 16, 2048, 4096, 8192
- 23 - returns the number of characters of the text content of the tag that is being closed; preceding and trailing spaces are not considered; stores the text content (preceding and trailing spaces, if any, are removed) in a variable named getvalueint23content; use in a tag close program only (New v5.4930)
- 24 - returns 1 if checking an external style sheet, else returns 0 (New v5.4930)
- 25 - returns 1 if the current tag is closed with "/>", else returns FALSE; use in a tag name open program, attribute program, or attribute value program only (New v5.5100)
- 26 - returns 1 if accessibility checking is enabled else returns 0 (New v5.9910)
- 27 - returns 1 if WCAG 1.0 accessibility checking is enabled else returns 0 (New v5.9910)
- 28 - returns 1 if Section 508 accessibility checking is enabled else returns 0 (New v5.9910)
- 29 - returns 1 if both accessibility checking and WCAG 1.0 accessibility checking are enabled else returns 0 (New v5.9910)
- 30 - returns 1 if both accessibility checking and Section 508 accessibility checking are enabled else returns 0 (New v5.9910)
- 31 - returns 1 if the enable sound option is checked else returns 0 (New v5.9920)
- 32 - returns the number of CDATA sections in the document (New v5.9920)
- 33 - returns 1 if WCAG Priority 1 messages should be displayed, else returns 0 (New v5.9930)
- 34 - returns 1 if WCAG Priority 2 messages should be displayed, else returns 0 (New v5.9930)
- 35 - returns 1 if WCAG Priority 3 messages should be displayed, else returns 0 (New v5.9930)
- 100 - returns the current four-digit year (local time) (New v6.0091)
- 101 - returns the current month (1-12, local time) (New v6.0091)
- 102 - returns the current day (1-31, local time) (New v6.0091)
- 103 - returns the current hour (0-23, local time) (New v6.0091)
- 104 - returns the current minute (0-59, local time) (New v6.0091)
- 105 - returns the current second (0-59, local time) (New v6.0091)
- 106 - returns the current millisecond (0-999, local time) (New v6.0091)
- 107 - returns the current day of the week (0-6, Sunday=0, Monday=1, etc., local time) (New v6.0091)
- Returns -1 if an error occurs, such as if valueidentifier is invalid. This function will not generate a validator error message if it returns -1 because valueidentifier is invalid.
- This function is implemented only in CSE HTML Validator v3.04 and later.
int hasEqual(int exp index)
- Returns 1 if the attribute at index has an equal sign following it, else returns zero.
int isCatActive(int exp category id)
- category id - the id of the category to check
- If the category is active, the function returns 1, else the function returns 0. The active categories are set in the Configuration Editor.
int isDefined(string exp name)
- name - the name of the variable
- Returns 0 if the variable name has not been defined, else the function returns nonzero.
int isFlagSet(int exp flag)
- flag - the tag name program flag to check
- If the tag name program flag is set, the function returns 1, else the function returns 0. The tag name program flags are set in the Validator Options Dialog Box.
int isInRange(string exp tagname1[, string exp tagname2...])
- Returns a positive integer if the current tag is in the range of any of the listed tag names, else the function returns 0. A tag name (called tag1) is in the range of another tag (called tag2) if tag2 has been opened but not closed before tag1.
int isValueInArray(string exp arrayname, string exp value[, int flags]);
- Checks to see if the value value is in the array of values named arrayname.
- Returns the first index into the array that equals value or returns -1 if valueis not found.
- flags
- 1 - case sensitive search (else case insensitive search)
- This function is implemented only in CSE HTML Validator Pro v4.52 and later.
int matchCase(string exp string, string exp str1[, string exp str2...])
int matchNoCase(string exp string, string exp str1[, string exp str2...])
- These functions compare a string to a list of strings to see if string matches any of the strings in the list. If string does not match any strings, these functions will return 0, else the functions return 1 or greater. For instance, if string matches str1, the functions will return 1, if string matches str2, the functions will return 2, etc.
- matchCase performs a case sensitive compare, while matchNoCase performs a case insensitive compare.
int strcmp(string exp string1, string exp string2)
int stricmp(string exp string1, string exp string2)
int strncmp(string exp string1, string exp string2, int exp
length)
int strnicmp(string exp string1, string exp string2, int exp length)
- These functions compare two strings and return a comparison value. The function returns a value of zero, less than zero, or greater than zero if string1 is equal to, less than, or greater than string2, respectively.
- strcmp and strncmp perform a case sensitive compare
- stricmp and strnicmp perform a case insensitive compare
- functions with a length parameter only compare up to the first length characters
int strlen(string exp string)
- Returns the length, in characters, of string.
- This function is implemented only in CSE HTML Validator v3.04 and later.
Functions Returning Floats
float getValueFloat(int exp valueidentifier)
- valueidentifier - tells the function which value to return
- 1 - the validation time in seconds
- Returns -1 if an error occurs, such as if valueidentifier is invalid.
- This function is implemented only in CSE HTML Validator Pro v4.00 and later.
Functions Returning Strings
string convertString(int exp flags, string exp string)
- flags - tells the function what to do to string
- 1 - convert character entities (for example, convert " to ")
- 2 - extracts a link from a string in the format linkpage("link") or linkpage('link'); returns an empty string if no link can be extracted (New v4.5031)
- 4 - try to extract a charset from string by returning what is found after "charset=" in string; returns the extracted charset or an empty string if a charset could not be extracted (New v4.9910)
- 8 - convert consecutive whitespace characters in string to single space characters (New v5.9910)
- 16 - remove space characters in string (New v5.9930)
- 65536 - remove preceding and trailing whitespace characters from string (New v5.9910)
- If flags specifies unknown flags or an error occurs, the function may return string unmodified. It will not generate an error.
- This function is implemented only in CSE HTML Validator v4.50 and later.
string getAttName(int exp index)
- Returns an attribute of the tag, specified by index. The first attribute has an index of 1. An index of 0 returns the current tag name.
- Generates an error if the attribute at the given index does not exist.
string getAttValue(int exp index)
- Returns the attribute value of an attribute of the tag, specified by index. The first attribute value has an index of 1, and is the attribute value for the attribute that also has an index of 1. An index of 0 is the value attached to the tag name which generally should not exist.
- The attribute value returned is the value after the entities have been replaced with their corresponding characters.
- Generates an error if the attribute at the given index does not exist, because if the attribute doesn't exist, it can't have a value.
string getAttValueEx(int exp index, int exp flags)
- Returns the attribute value of an attribute of the tag, specified by index. The first attribute value has an index of 1, and is the attribute value for the attribute that also has an index of 1. An index of 0 is the value attached to the tag name which generally should not exist.
- flags
- 1 - get the value after entities have been replaced with characters
- 2 - get the value before entities have been replaced with characters
- Generates an error if the attribute at the given index does not exist, because if the attribute doesn't exist, it can't have a value.
- This function is implemented only in CSE HTML Validator v5.02 and later.
string getMidString(string exp string, int exp startindex, int exp length)
- Returns a substring of string. The substring begins at the 0 based index startindex and is length characters long.
- If length is -1, the returned string begins at startindex and ends at the last character of string.
- This function is implemented only in CSE HTML Validator v3.04 and later.
string getTagName()
- Returns the current tag name that the validator is validating.
- The tag name is returned as used in the document without any case conversion. For example, if <BoDy> is used in the document, getTagName() returns BoDy.
string getValueString(int exp valueidentifier)
- valueidentifier - tells the function which string value to return
- 1 - the directory where HTML Validator is installed (ends with a \)
- 2 - the directory where Windows is installed (uses the GetWindowsDirectory() API function and only ends in a \ if Windows is installed in a root directory)
- 3 - the !DOCTYPE declaration (starts with !DOCTYPE and does not include the < and > characters at the beginning and end of the string) (New v4.05)
- 4 - the version of the configuration being used (as specified in the Notes tab of the Configuration Editor) (New v4.5020)
- 5 - the filename (with full path if available) of the file being validated (if available) (New v4.5020)
- 6 - the filename (without path) of the file being validated (if available) (New v4.5022)
- 7 - returns " If you are using HTML Validator's integrated editor, you can add this from the Tags menu and/or from the Tag Inserter." (New v4.5094)
- 8 - a message about the DOCTYPE ($doctypestring) not being recognized if it is not in the recognized DOCTYPE list; use only in a DOCTYPE tag name program; returns "" if $doctypestring is in the list or if the list is empty (New v4.9940)
- 9 - the sound file to play when errors and/or warning messages are present (New v5.0200)
- 10 - the sound file to play when no errors and/or warning messages are present (New v5.0200)
- 11 - returns " /" if document is XHTML or "" if not (New v5.4930)
- 12 - returns "/" if document is XHTML or "" if not (New v5.4930)
- 13 - returns the text (entities not converted) contained in the tag that is being closed, excluding beginning and trailing spaces; use in a tag close program only; to get the location of this text, call getLocation(3,0) (New v5.4930)
- 14 - returns the document type (based mainly on the DOCTYPE); example: "XHTML 1.1", "strict HTML 4.0/4.01", "strict XHTML 1.0", etc. (New v5.4950)
- 15 - returns the document type with "a" or "an" preceding it (based mainly on the DOCTYPE); example: "an XHTML 1.1", "a strict HTML 4.0/4.01", "a strict XHTML 1.0", etc. (New v5.4950)
- 16 - if the "align" attribute is used then returns a string, starting with a space, asking to consider CSS instead of the "align" attribute (New v5.9910)
- 17 - if the "bgcolor" attribute is used then returns a string, starting with a space, asking to consider the CSS "background-color" property instead of the "bgcolor" attribute (New v5.9910)
- 18 - if the "align" attribute is used then returns a string, starting with a space, asking to consider the CSS "text-align" property instead of the "align" attribute (New v5.9910)
- Returns "error" if an error occurs, such as if valueidentifier is invalid.
- This function is implemented only in CSE HTML Validator v3.04 and later.
string isInRangeEx(int exp flags, string exp tagname1[, string exp tagname2...])
- Returns the name of the tag that the current tag is in the range of (must be one of the listed tag names), else the function returns an empty string (""). A tag name (called tag1) is in the range of another tag (called tag2) if tag2 has been opened but not closed before tag1.
- flags
- 1 - if the current tag is in the range of a listed tag name, stores the line number where the tag appears in the variable named "$isinrangeexline".
- This function is implemented only in CSE HTML Validator v4.0310 and later.
string pluralize(string exp str, int num[, int mode)
- str - the string to pluralize
- num and mode- determines what to do
- If mode is 0 (the default), returns str if num is 1, else returns str+"s"
- If mode is 1, returns str+"y" if num is 1, else returns str+"ies"
- This function is implemented only in CSE HTML Validator Pro v4.00 and later.
string toLower(string exp string)
- string - the string to convert to lowercase
- This function is implemented only in CSE HTML Validator Pro v4.00 and later.
string toString(int exp convert)
- convert - integer to convert to a string
string toStringF(float exp convert[, string format])
- convert - float to convert to a string
- format - how to format the returned string, default is "%.2f" for 2 decimal places
- WARNING: A bad format string may cause CSE HTML Validator to crash.
- This function is implemented only in CSE HTML Validator Pro v4.00 and later.
string toUpper(string exp string)
- string - the string to convert to uppercase
- This function is implemented only in CSE HTML Validator Pro v4.00 and later.
Functions Returning Locations
location getAttLocation(int exp index)
- Returns the location of the first character of an attribute of the tag, specified by index. The first attribute has an index of 1. An index of 0 returns the location of the first character of the tag name.
- Generates an error if the attribute at the given index does not exist.
location getAttValueLocation(int exp index)
- Returns the location of the first character of an attribute value of an attribute of the tag. index is the index of the attribute whose value you want the location of. The first attribute has an index of 1.
- Generates an error if the attribute at the given index does not exist or if index is 0 or less.
location getLocation(int exp locid, int exp auxint)
- Returns a location based on locid and auxint.
- locid - location ID
- 1 - location of a structure component; auxint is the structure component's ID number
- 2 - location of tag with all attributes and values (New v4.9940)
- Use 0 for auxint for standard behavior
- Use 1 for auxint to include ending spaces (New v5.4910)
- Use 2 for auxint to only include ending spaces (New v5.4910)
- 3 - location of the text referred to in getValueInt(23) or getValueString(13); auxint should be 0 (New v5.4930)
- 4 - location of the last child of the current node; auxint should be 0 (New v5.9920)
- As of v4.9940, the flags parameter has been changed to locid.
- This function is implemented only in CSE HTML Validator Pro v4.5091 and later.
Procedures
activateCategory(int exp categoryid, int exp activate);
- categoryid - the category id of the category to activate or deactivate
- activate - if positive, activates the category, if negative, deactivates the category
- To deactivate all categories, use -1 for categoryid and 0 for activate
- This procedure does nothing if you try to deactivate a category that is not active or activate a category that doesn't exist.
- This function is implemented only in CSE HTML Validator Pro v4.00 and later.
activateCategories(int exp activate[, int exp categoryid...]);
- categoryid - the category id of the category to activate or deactivate
- activate - if positive, activates the category, if negative, deactivates the category
- This procedure does nothing if you try to deactivate a category that is not active or activate a category that doesn't exist.
- This function is implemented only in CSE HTML Validator Pro v5.4940 and later.
checkAttributes(int exp flags, string exp att1[, string exp att2...]);
- flags
- 1 - display a standard warning message if any of the listed attributes have values that have leading or trailing spaces; if a listed attribute does not exist then it is treated as though it does not have leading or trailing spaces.
- 2 - add "[33] " to the beginning of the standard warning message.
- attx - an attribute
- This function is implemented only in CSE HTML Validator Pro v4.0320 and later.
checkStyle(int exp flags)
- flags
- 1 - check the "style" attribute value if style checking is enabled; if there is no "style" attribute in the current tag, then this function does nothing.
- 2 - check the style declarations in contained in the tag; use this only in a tag name closing program like the tag name closing program for the "script" element.
- This function does not do anything if style checking is not enabled.
- This function is implemented only in CSE HTML Validator Pro v4.9910 and later.
runLinkCheckProgramForTags(string exp tagname1[, string exp tagname2...])
- Specifies the elements that cause the link check tag name program to execute during a link check. Results in a significant performance improvement compared to not using this function.
- This function can only be used in the link check tag name program so it has no use or effect in other tag name programs or when validating.
- This function is implemented only in CSE HTML Validator Pro v4.4910 and later.
setClosed(int exp id);
- id - the ID number of the tag name to mark as closed; this ID is the ID of the tag name in the document structure, not in the configuration
setValidated(int exp index, int exp what);
- index - the index of the attribute and/or attribute value to set
- what - what to set (specifies to set the attribute, the attribute value, or both)
- $SET_ATTRIBUTE - set the attribute to be valid so that no error messages are generated for the attribute
- $SET_ATTVALUE - set the attribute value to be valid so that no error messages are generated for the attribute value
- To set both at the same time, use $SET_ATTRIBUTE+$SET_ATTVALUE.
setValueString(int exp valueidentifier, string exp value)
- valueidentifier - tells the function which string value to set
- 1 - a string that is used to override the default warning string about not using a space character before a '/' character in XML style empty tags
- 2 - add the value string to the list of validation modes; good to use in the onConfigLoad() function to specify new validation modes. The first string added will have a CSEJOBSUBTYPE of 1, the second string added will have a CSEJOBSUBTYPE of 2, etc. (New v4.5091)
- 3 - add the value string to the list of recognized doctypes; good to use in the onConfigLoad() function (New v4.9940)
- 4 - set the DOCTYPE tag name program to value; good to use in the onConfigLoad() function (New v4.9940)
- 5 - set the XML declaration tag name program to value; good to use in the onConfigLoad() function (New v5.4910)
- 6 - set the comment tag name program to value; good to use in the onConfigLoad() function (New v5.4910)
- 7 - set the ignore to end tag name program to value; good to use in the onConfigLoad() function; program is run when a nested ignore to end tag is encountered (New v5.4920)
- 8 - limit messages to those in the value category; can be called repeatedly to limit messages to multiple categories (New v5.4930)
- 9 - set the entity tag name program to value; good to use in the onConfigLoad() function (New v5.4940)
- This function is implemented only in CSE HTML Validator v4.05 and later.
setValueStringEx(int exp valueidentifier1, int exp valueidentifier2, int exp arg1, string exp value)
- valueidentifier1 - what string value to set
- 1 - set an attribute value string
- valueidentifier2 - further specifies which string to set
- 1 - the attribute value tag name program
- arg1 - the attribute value ID
- value - the string value
- This function is implemented only in CSE HTML Validator v5.00 and later.
unDefine(string exp name1[, string exp name2...]);
- namex - the list of variable names to remove from memory
- After this function is used on a variable, such as name1, isDefined("name1") will again return zero. Accesses to the variable name will fail because it will no longer exist.
- If a variable name in the list is already undefined, then the function has no effect on the undefined variable name.
- Example: To remove a variable named var from memory, use unDefine("var"), do not use unDefine($var).
Combination Functions and Procedures
int addValue(string exp name, string exp value[, int flags]);
- Adds the value value to the end of an array of values named name.
- flags
- 1 - do not add if value is empty, that is, if it is equal to "".
- 2 - do not add if value is ASP, PHP, MIVA, etc. This usually indicates that ASP, PHP, etc. code has been converted to the corresponding string (New v5.9910)
- Returns the index into the array name where value has been stored. If an error occurred or no value was stored, then addValue() returns -1.
- This function is implemented only in CSE HTML Validator Pro v4.00 and later.
int checkRange(int exp flags, int exp returntype, string exp isopentag, string exp tagname1[, string exp tagname2...]);
- flags
- 1 - display a default error message if isopentag is currently open, but tagname1, tagname2, etc. are all not open, else the default error message is not displayed
- 2 - don't consider the last added component when searching for isopentag (New v4.5000)
- This function's return value depends on returntype:
- If returntype is $RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.
- If returntype is $RETURN_LISTINDEX, then the return value is 0 if isopentag is not open, 1 if isopentag is open but no tagnamex is open, and 2 or greater if isopentag is open and tagnamex is open. If the value is 2 or greater, the return value indicates the first tagnamex in the list that is open.
- tagnamex - a tag name to check to see if it is currently open; tagnamex is only checked to see if it is open if isopentag is open, and if isopentag is open, then tagnamex is only considered to be open if tagnamex is opened after isopentag
- Functionality change in CSE HTML Validator Pro v4.50 and later: display has been replaced with flags
int checkRangeEx(int flags, string exp tagname1[, string exp tagname2...]);
- flags
- 1 - display default message (if any)
- 2 - (valid only in text program) check to make sure that no tag name in the list of tag names is opened; if one or more tag names are open then displays an error message that text cannot be used in the opened tag name (message displayed only if flag 1 is also set) and returns 1 if the opened tag is tagname1, 2 if tagname2, etc.; if no tag name in the list is open, then returns 0
- tagnamex - list of tag names
- This function is implemented only in CSE HTML Validator Pro v4.05 and later.
int checkTagAttributes(int exp checktype, int exp flags[, any optional parametes])
- checktype
- 1 - supply two additional string parameters, attname and valuecontains; checks the last child of the current node and returns 1 if it contains an attribute named attname and that attribute has a value that contains the string valuecontains, else returns 0; a case insensitive compare is made; valuecontains may be anywhere in the value
int checkTagContents(int exp checktype, int exp flags, int exp msgid, string exp tagname1[, string exp tagname2...])
- checktype
- 1 - check all tagname1 tags to make sure that they contain nothing other than tagname2, tagname3, etc. and no other elements
- flags (when checktype is 1)
- 1 - display appropriate error messages if needed
- 2 - tagname1 tags must directly contain at least one of the allowed elements; if a message is generated due to this flag, the message id used will be msgid+1 unless msgid is -1
- 4 - the msgid is only for messages caused by flag 2 (1 will not be added to msgid in this case); messages caused by flag 1 will not have a message ID
- 8 - check only the last child of the current node (good to use in end tag name programs)
- 16 - after msgid, include a string to prepend to any displayed messages
- 32 - only check to make sure that tagname1 tags directly contain at least one of the allowed elements (sets flag 2 and does not display error messages for tags used that are not listed as an allowed tag in the function parameters); returns 1 or greater (indicating which allowed element was used) if an allowed element is used
- Default return value is 0
- 2 - returns 1 if the last child of the current node contains a "th" element (does not look in "td" elements), else returns 0; DO NOT SUPPLY ANY PARAMETERS OTHER THAN checktype
- msgid - the message ID to use if any messages are generated; use -1 for no message ID
- This function is implemented only in CSE HTML Validator Pro v5.9910 and later.
int checkTagUsed(int exp flags, int exp returntype, string exp isopentag[, string exp tagname1, string exp tagname2...]);
- flags
- 1 - display the default error message if all tagnames have not been used after isopentag
- 2 - use the open tag for the last closed tag instead of isopentag; do not supply the isopentag parameter if using this flag
- 4 - don't consider the last added component when searching for any tagnamex
- 8 - before isopentag, specify a tag, excludetag, so that if tagnamex is contained in excludetag, then it is as if that occurrence of tagnamex did not occur; do not use with flag 16
- 16 - when using this flag, specify an integer, numexcludetags, after flags to specify the number of excludetagx's that will be specified before isopentag; this flag is similar to flag 8, but allows you to specify more than one excludetag; do not use with flag 8
- 32 - display an warning message if no tagnamex's are supplied and no tags are found after isopentag; if any tag is found, no message is displayed; use with flag 1 (good to use in a end tag name program to generate an error message if the tag that was closed contains no tags - example:
checkTagUsed(39, $RETURN_NOTUSED);
)
- 64 - immediately after flags, specify a string to prepend to any message that is generated
- 128 - if a tag name is found, save the tag name in the variable checktagusedtagname (New v4.5091)
- 256 - if a tag name is found, save the tag name's structure ID number in the variable checktagusedtagnameid (New v4.5091)
- 512 - if isopentag is opened, save the line number that it was opened in in the variable checktagusedopenlinenum (New v4.5091)
- Order for specifying additional parameters after flags: 16, 64
- This function's return value depends on returntype:
- If returntype is $RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.
- If returntype is $RETURN_LISTINDEX, then the return value is 0 if isopentag is not open, 1 if isopentag is open but no tagnamex has been used, and 2 or greater if isopentag is open and any tagnamex has been used. If the value is 2 or greater, the return value indicates the first tagnamex in the list that has been opened after isopentag.
- tagnamex - a tag name to check to see if it has been used after the last, still opened, isopentag; tagnamex is only checked to see if it has been used if isopentag is open
- If no tagnamex tags are supplied, then any tag after isopentag in the document structure is considered to match tagnamex; if a match is made then returns 2
- This function is implemented only in CSE HTML Validator Pro v4.50 and later.
int Message(int exp display, int exp messagetype, string exp message[, location exp location]);
- display - if nonzero, the message is displayed; if zero (0), the message is not displayed
- messagetype - the type of message to display
- $MSGBOX_INFORMATION - displays a standard windows information dialog box on the display; returns 1
- $MSGBOX_ERROR - displays a standard windows error dialog box on the display; returns 1
- $MSGBOX_WARNING - displays a standard windows warning dialog box on the display; returns 1
- $MSGBOX_YESNOQUESTION - displays a standard windows question dialog box on the display with Yes and No buttons; returns 1 if the user answers Yes or returns 0 if the user answers No
- $MSG_ERROR - adds an error message to the message output of the validator; returns 1
- $MSG_WARNING - adds a warning message to the message output of the validator; returns 1
- $MSG_COMMENT - adds a comment message to the message output of the validator; returns 1
- $MSG_MESSAGE - adds a general message to the message output of the validator; returns 1
- message - the actual message string to display
- location - (OPTIONAL) points to the location in the html document that caused the message to be generated; the default is the first character of the tag name; this parameter is not used if messagetype is a MSGBOX.
- Do not use the optional location argument if using a $MSGBOX_* message type.
- Start validation and end validation programs may only display comment type messages.
int MessageEx(int exp flags, int exp messagetype, string exp category, string exp message[, location exp location]);
- flags
- 1 - if set, the message is displayed; if not set, the message is not displayed
- 2 - message is a style message to be displayed in the Styles tab of the integrated editor (New v4.9920)
- 4 - following the flags parameter is an integer which is the message's unique ID number (New v5.4930)
- 8 - message has no category; do not supply the category parameter (New v5.4930)
- 16 - message is an accessibility message to be displayed in the Accessibility tab of the integrated editor (New v5.9910)
- 32 - message is a "priority 1" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)
- 64 - message is a "priority 2" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)
- 128 - message is a "priority 3" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)
- messagetype - the type of message to display
- $MSGBOX_INFORMATION - displays a standard windows information dialog box on the display; returns 1
- $MSGBOX_ERROR - displays a standard windows error dialog box on the display; returns 1
- $MSGBOX_WARNING - displays a standard windows warning dialog box on the display; returns 1
- $MSGBOX_YESNOQUESTION - displays a standard windows question dialog box on the display with Yes and No buttons; returns 1 if the user answers Yes or returns 0 if the user answers No
- $MSG_ERROR - adds an error message to the message output of the validator; returns 1
- $MSG_WARNING - adds a warning message to the message output of the validator; returns 1
- $MSG_COMMENT - adds a comment message to the message output of the validator; returns 1
- $MSG_MESSAGE - adds a general message to the message output of the validator; returns 1
- category - specify what category the message belongs in; for example, messages about compatibility with Microsoft Internet Explorer can all be grouped under the category "Microsoft Internet Explorer"
- message - the actual message string to display
- location - (OPTIONAL) points to the location in the html document that caused the message to be generated; the default is the first character of the tag name; this parameter is not used if messagetype is a MSGBOX.
- Do not use the optional location argument if using a $MSGBOX_* message type.
- Start validation and end validation programs may only display comment type messages.
- This function is implemented only in CSE HTML Validator v4.50 and later.
int playSound(string exp filename[, int exp options])
- Plays the sound file filename asynchronously.
- options - can be added together (options is optional)
- 1 - play sound asynchronously (defaults to playing synchronously)
- 2 - play sound using soundplayer.exe included with CSE HTML Validator (other options may have no effect); allows sound to continue playing even after HTML Validator terminates
- Returns 1 if successful, else returns 0.
- This function is implemented only in CSE HTML Validator v3.04 and later.
int requireAllAttributes(int exp flags, string exp att1[, string exp att2...]);
- flags
- 1 - display a default error message if one of the listed attributes is not used
- 2 - immediately after flags, include a string to prepend to the default error message (requires flag 1) (New v4.5000)
- 4 - immediately after flags (unless flag 2 is used), specify that attribute that creates the requirement (requires flag 1) (New v4.9910)
- 8 - immediately after flags (unless flag 2 or 4 is used), specify a message ID (New v5.9930)
- attx - an attribute
- This function returns 0 if all of the listed attributes are used, or returns 1 or greater if one or more of the listed attributes are not used:
- The function returns 1 or greater if one or more of the listed attributes are not used. For instance, 1 is returned if the first listed attribute is not used (att1), 2 if the second (att2), and so on. If more than one of the listed attributes is not used, the return value indicates the first attribute in the list that is not used.
- If the return value is 1 or greater, and flag 1 is set, then a standard error message will be generated stating that the tag requires all of the listed attributes.
- Functionality change in CSE HTML Validator Pro v4.50 and later: display has been replaced with flags
int requireMutuallyExclusiveAttributes(int exp display, int exp returntype, string exp att1[, string exp att2...]);
- display - if nonzero, a default error message is displayed if more than one of the listed attributes are used, if zero (0), the default error message is not displayed
- attx - an attribute
- This function returns -2 if none of the listed attributes are used, -1 if more than one of the listed attributes is used, and 1 or greater if exactly one of the listed attributes is used:
- If returntype is $RETURN_LISTINDEX, the function returns 1 or greater if exactly one of the listed attributes is used. For instance, 1 is returned if the first listed attribute is used (att1), 2 if the second (att2), and so on. If more than one attribute is used, the return value is -1.
- If returntype is $RETURN_ATTINDEX, the function returns 1 or greater if exactly one of the listed attributes is used. The return value is the index of the used attribute. If more than one attribute is used, the return value is -1.
- If returntype is $RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.
- If the return value is -1, and display is nonzero, then a standard error message will be generated stating that the tag requires listed attributes to be mutually exclusive.
int requireOneAttribute(int exp flags, int exp returntype, string exp att1[, string exp att2...]);
- flags
- 1 - display a default error message if none of the listed attributes are used
- attx - an attribute
- This function returns -1 if none of the listed attributes are used, else the function returns 1 or greater:
- If returntype is $RETURN_LISTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. For instance, 1 is returned if the first listed attribute is used (att1), 2 if the second (att2), and so on. If more than one attribute is used, the return value indicates the first attribute used in the list.
- If returntype is $RETURN_ATTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. The return value is the index of the attribute. If more than one attribute is used, the return value is the index of the attribute that appears first in the list.
- If returntype is $RETURN_FIRSTATTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. The return value is the index of the attribute that appears first in the tag and is anywhere in the list, and not necessarily the index of the attribute that is in the tag and appears first in the list.
- If returntype is $RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.
- If the return value is -1, and flags&1 is 1, then a standard error message will be generated stating that the tag requires at least one of the listed attributes.
- Functionality change in CSE HTML Validator Pro v5.00 and later: display has been replaced with flags.
int runProgram(int exp programnum[, int exp programnum...])
- Runs a built in "tag name program". Helps to improve performance because the program is precompiled.
- programnum
- 1 - run built in text tag name program, returns 0 if successful or a negative number if an error occurs
- 2 - run built in end tag name program for the "p" element, returns 0 if successful or a negative number if an error occurs (New v4.5091)
- 3 - run for "alt" attributes to check for alt text containing only white space characters and to generate appropriate accessibility messages if so (New v5.9910)
- 4 - run an attribute program that checks the attribute's value for possibly misspelled words (New v4.5091)
- 5 - run for "alt" attributes to check alt text for beginning with inappropriate strings like "click here", "goto", and "link to" and to generate appropriate accessibility messages if so (New v5.9910)
- 6 - run for "alt" attributes to check for inappropriate alt text like "image", "picture", and "alt text" and to generate the appropriate accessibility messages if so (New v5.9910)
- 7 - run for "alt" attributes to check for alt text longer more than 150 characters and to generate the appropriate accessibility messages if so (New v5.9910)
- 8 - run a tag name program that checks if the element's use is OK with regard to its use in strict HTML/XHTML documents; a warning message will be displayed if the tag should not be used because the document was declared as being a strict HTML 4 or XHTML document (New v4.5093)
- 9 - run for elements that provide programmatic functions (like "applet", "script", and "object") and generate appropriate accessibility messages about making sure that the page is usable without these these programmatic functions (New v5.9910)
- 10 - run for device-dependent event handlers like "onmouseout" and "onmouseover" and generate appropriate accessibility messages about using logical event handlers instead (New v5.9910)
- 11 - run for "frame" and "iframe" elements to check the "title" attribute for inappropriate titles and to generate appropriate accessibility messages (New v5.9910)
- 12 - run for "a" element to check the "href" attribute for "javascript:" and to generate appropriate accessibility messages (New v5.9910)
- 13 - displays appropriate accessibility style sheet messages when a style sheet is used (New v5.9910)
- 14 - displays appropriate accessibility messages about using style sheets (CSS) instead of presentational HTML/XHTML markup (New v5.9910)
- 15 - displays an accessibility message about ordering heading elements properly (the message is displayed only once) (New 20030130)
- 16 - run a tag name program that checks if the attribute's use is OK with regard to its use in strict HTML/XHTML documents; a warning message will be displayed if the attribute should not be used because the document was declared as being a strict HTML 4 or XHTML document (New v4.5110)
- 17 - run in the "coords" attribute tag name program to check the value of the "coords" attribute (New v5.9910)
- 18 - run in "headers" attribute program to check the "headers" attribute value; table cell IDs must be stored in an array named "tablecellidusedarray" (New v5.9910)
- 19 - run in "accesskey" attribute program to check for duplicate accesskey values (New v5.9910)
- 20 - run at end of the validation to check for the use of labels with form controls such as "input", "select", and "textarea" (New v5.9930)
- 21 - run in tag name programs to place the current tag's attributes and attribute values in the node structure because they may be needed later (New v5.9930)
- 22 - checks $contentvalue for a valid robot meta tag content value; sets $runprogram22result with results ("" if OK, or other if not) (New v6.0100)
- 32 - adds $value (excluding "#") to $internallinksarray and increments $numinternallinks if $value is not already in the array (New v4.5200)
- 64 - if tag name program flag 11 is set, plays a sound according to how many errors and warnings (if any) are present (New v5.00)
- 128 - program to handle validation modes (New v5.00)
- 256 - run in onConfigLoad() function (New v5.00)
- 512 - run for non-XHTML 1.1 and non-HTML 4.0x strict tags (New v5.02)
- 1024 - run for XHTML 1.1 and HTML 4.0x strict tags that may contain non-XHTML 1.1 or non-HTML 4.0x strict attributes (New v5.02)
- 2048 - run in the attribute program for non XHTML 1.1 and HTML 4.0x attributes (New v5.4930)
- 4096 - run in the tag name close program for the "a" element that checks to see if the contents is something like "click here", if so, displays a style message (New v5.4930); also checks for Internet addresses (like http://www.domain.com) in link descriptions and generates a style message if found because readers may try to pronounce them (New v5.9920)
- 8192 - generate an error message if the tag is nested within itself; use in a tag name open program (New v5.4930)
- 16384 - check for "height" and "width" attributes that have percents as values and display a message about potential issues (New v5.4940)
- 32768 - for end tag name programs; displays a warning message if the contents of the tag does not begin with <!--; good to run for the "style" and "script" tag name close programs (New v5.4940)
- 65536 - run for tags that might contain deprecated XHTML attributes (New v5.4940)
- 131072 - run for tags that must be contained in an inline or block element in strict XHTML 1.0, XHTML 1.1, or XHTML Basic documents (New v5.4950)
- 262144 - run for attributes that may have browser specific color values (like UI color names); displays a message about them (New v5.5000)
- 524288 - run to check "width" attributes that specify widths greater than 100% and to display compatibility messages about using widths greater than 100% (New v5.5100)
- 1048576 - run to check "src" attributes that specify BMP images (with a .bmp file extension) and to display a message about BMP compatibility if a BMP image is specified(New v5.5100)
- Returns 0 if programnum is unknown or HTML Validator doesn't know how to handle it. An error message will not be generated.
- Functionality change in CSE HTML Validator Pro v4.5091 and later: flags has been replaced with programnum.
- Functionality change in CSE HTML Validator Pro v5.4950 and later: accepts multiple programnums separated by commas.
- Do not use the runProgram() function unless you completely understand what you are doing.
- This function is implemented only in CSE HTML Validator v4.50 and later.
int setFlag(int exp flagset, int exp flag, int exp value);
- flagset - the set of flags where flag is contained
- 1 - CSECFGVALFLAGS1
- 2 - CSECFGVALOUTPUTFLAGS
- 3 - CSECFGVALENTITYFLAGS
- 4 - CSECFGGENFLAGS
- 5 - CSECFGNETFLAGS
- 6 - CSECFGTOOLFLAGS
- 7 - CSECFGLOGFLAGS
- 8 - CSECFGTAGNAMEPROGRAMFLAGS; flag is the tag name program flag number
- 9 - CSECFGVALFLAGS2
- 50 - "\Validator\ValidatorFlagsxx" (CSECFGVALFLAGS1), flag ignored, set all flags at once (New v4.5010)
- 51 - "\Validator\OutputFlagsxx" (CSECFGVALOUTPUTFLAGS), flag ignored, set all flags at once (New v4.5010)
- 52 - "\Validator\EntityFlagsxx" (CSECFGVALENTITYFLAGS), flag ignored, set all flags at once (New v4.5010)
- 53 - "\General\Flagsxx" (CSECFGGENFLAGS), flag ignored, set all flags at once (New v4.5010)
- 54 - "\Network\Flagsxx" (CSECFGNETFLAGS), flag ignored, set all flags at once (New v4.5010)
- 55 - "\Tools\Flagsxx" (CSECFGTOOLFLAGS), flag ignored, set all flags at once (New v4.5010)
- 56 - "\Logging\Flagsxx" (CSECFGLOGFLAGS), flag ignored, set all flags at once (New v4.5010)
- 60 - "\Validator\ProgramFlagsxx" (tag name program flags 1-30), flag ignored, set all flags at once (New v4.5010)
- 61 - "\Validator\ProgramFlags2xx" (tag name program flags 31-60), flag ignored, set all flags at once (New v4.5010)
- 62 - "\Validator\ProgramFlags3xx" (tag name program flags 61-90), flag ignored, set all flags at once (New v4.5010)
- 63 - "\Validator\ProgramFlags4xx" (tag name program flags 91-120), flag ignored, set all flags at once (New v4.5010)
- 64 - "\Validator\ProgramFlags5xx" (tag name program flags 121-150), flag ignored, set all flags at once (New v4.5010)
- 65 - "\Validator\ProgramFlags6xx" (tag name program flags 151-180), flag ignored, set all flags at once (New v4.5010)
- 200 - CSERESULTSTATUSFLAGS (New v4.5000)
- flag - the flag to set or read; a bitmask unless otherwise noted
- value - the new value of the flag; 1 to set the flag, 0 to clear the flag, and anything else, such as -1, to read the flag (the function returns the flag's value)
- The function returns the original value of the flag (0 or 1) before it was changed (if it was changed).
- flagsets 50-69 allow one to easily override most or all of the checkbox options in the Validator Engine Options for a given configuration file. To use these flagsets, set up the Validator Engine Options the way that you want and then press the Save Now button to save the options to the registry. You can then use the Registry Editor to view the values of certain registry entries. Use these values and the setFlag() function in the start validation tag name program of the configuration file to override the user's currently selected Validator Engine Options. For example, in CSE HTML Validator Professional v4.5, set up the Validator 2 tab of the Validator Engine Options the way that you want, press the Save Now button, then go to the Registry Editor to get the value for "ValidatorFlags40" in "HKEY_CURRENT_USER\Software\AI Internet Solutions\CSE HTML Validator v4\Validator DLL\Validator". Let's say this value is 1057088279. Now you can override most or all of the Validator 2 tab of the Validator Engine Options by adding this line to the start validation tag name program of the configuration file that you want modify: setFlag(50,0,1057088279);.
- This function is implemented only in CSE HTML Validator Pro v4.00 and later.
int setFlagEx(int exp flagset, int exp flag, int exp arg1, int exp value);
- flagset - what to set
- 1 - set an attribute value option
- flag - further specifies which flag to set
- 1 - enable attribute value program
- arg1 - the attribute value ID
- value - 0 (false) or nonzero (true)
- The function returns the original value of the flag (0 or 1) before it was changed (if it was changed).
- Returns -1 if any arguments are not supported. An error message will not be generated.
- This function is implemented only in CSE HTML Validator Pro v5.00 and later.
int setInt(string exp name, int exp value);
- name - the name of the variable being created or changed; must follow the rules for variable names
- value - the integer value to set the variable to
- Returns value.
- The variable name is created if it doesn't exist. If it already exists, the value of the variable becomes value.
int setPriority(int priority)
- Changes the priority of CSE HTML Validator.
- priority - can be one of the following
- 1 - low priority
- 2 - normal priority
- 3 - high priority
- Returns nonzero if successful, else returns 0.
- This function is implemented only in CSE HTML Validator v3.04 and later.
int setValueInt(int exp valueidentifier, int exp value)
- valueidentifier - tells the function which value to set
- value - what to set the value to
- 1 - sets configflags of the configuration, value is ORed with configflags, for value:
- 1 - configuration supports CSEJOBTYPELINKCHECK
- 2 - sets the flag to use for the message "found the character '>' with no previous matching '<' to open the tag..."
- 3 - ORs doctypeflags with value (New v5.4930)
- 4 - sets the flag to use for the error message that is generated when a tag is "quick closed" in an HTML document when it would cause possible compatibility issues. (New v5.4930)
- 5 - limit messages to those with the value flag set; can be called repeatedly to limit messages to multiple flags; for example, setValueInt(5,2) will limit messages to accessibility messages (New v5.9910)
- 20 - sets CSEJOBSUBTYPE
- Returns -1 if an error occurs, such as if valueidentifier is invalid. This function will not generate a validator error message if it returns -1 because valueidentifier is invalid.
- If valueidentifier is valid, returns the old value of valueidentifier.
- This function is implemented only in CSE HTML Validator v4.5091 and later.
[ Table of Contents ]
Copyright © 1997-2003 AI Internet Solutions.