Combo Functions/Procedures

  Previous topic Next topic  

These functions/procedures are usually used as procedures (the return value is not used), but they do return a value.

int addValue(string exp varname,
 string exp value[, int flags]);

Adds value to the end of an array of values named varname.

flags

1 - do not add if value is empty, that is, if it is equal to "".

2 - do not add if value contains "!ASP!", "!PHP!", "!MIVA!", etc. This usually indicates that ASP, PHP, etc. code has been converted to the corresponding string (New v5.9910); in v11.0010+, this has changed to "contains" from "equals"

Returns the index into the array varname 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 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, then 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 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 v4.05 and later.

int checkTagAttributes(int exp checktype, int exp
 flags[, any optional parameters]);

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

specify flag 1 instead of valuecontains to search for "layout" or its equivalent (New v10.9916)

2 - supply additional string parameters that are attribute names to check; for each attribute name, if the attribute was used then make sure the value does not contain only whitespace characters; the return value is the attribute index of the last attribute checked that had a value that contained only whitespace characters; if no values are found that contain only whitespace then the return value is 0 (New v10.9924)

specify flag 1 to generate an error message for every attribute whose value contains only whitespace characters

3 - supply two additional string parameters, attname and valueis; 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 equals the string valueis, else returns 0; a case insensitive compare is made (New v10.9950)

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, then 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

64 - tagname1 tags must contain, in order, one of each of the other listed tags (New v9.9914)

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 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 start 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, then 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 v4.50 and later.

int Message(int exp display, int exp messagetype,
 string exp message[, location exp location]);

display - if nonzero, then the message is displayed; if zero (0), then the message is not displayed

messagetype - the type of message to display

$MSGBOX_INFORMATION - displays a standard windows information dialog box on the display

$MSGBOX_ERROR - displays a standard windows error dialog box on the display

$MSGBOX_WARNING - displays a standard windows warning dialog box on the display

$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

$MSG_WARNING - adds a warning message to the message output of the validator

$MSG_COMMENT - adds a comment message to the message output of the validator

$MSG_MESSAGE - adds a general message to the message output of the validator

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 $MSGBOX_*.

Return value - see the return value for MessageEx();

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 msgid (use flag 4)],
 int exp messagetype[, string exp category (see flag 8)],
 string exp message[, location exp location]);

flags

1 - if set, then the message is displayed; if not set, then 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 WCAG 1.0 "priority 1/conformance level A" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)

64 - message is a WCAG 1.0 "priority 2/conformance level AA" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)

128 - message is a WCAG 1.0 "priority 3/conformance level AAA" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)

256 - if in standards compliant mode then upgrade messagetype to $MSG_ERROR (New v6.5020)

512 - message was generated by HTML Tidy (New v6.9941)

1024 - display message, overriding virtually any option or situation that would normally disable it (flag 1 must still be set to display the message) (New v7.0000)

2048 - message generated by nsgmls; internal use only - do not use (New v8.00)

4096 - message generated by PHP syntax checker; internal use only - do not use (New v8.9910)

8192 - for comment ($MSG_COMMENT) messages - place the message at the top of all comment messages; doesn't do anything for other message types (New v8.9930)

16384 (0x4000) - put message at the very top (New v8.9940)

32768 (0x8000) - message is a WCAG 2.0 conformance level "A" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v9.9912)

65536 (0x10000) - message is a WCAG 2.0 conformance level "AA" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v9.9912)

131072 (0x20000) - message is a WCAG 2.0 conformance level "AAA" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v9.9912)

262144 (0x40000) - if in standards compliant mode then upgrade messagetype (if not an error) to $MSG_WARNING (New v9.9931)

524288 (0x80000) - message was generated by the JavaScript linter (New v10.0032)

0x100000 - keyword density message (internal use only) (New v10.0047)

0x200000 - message generated by the XML parser; internal use only - do not use (New v10.9914)

0x400000 - message generated by JSLint; internal use only - do not use (New v10.9914)

0x800000 - if accessibility checking and WCAG 2.0 checking are both enabled, then also generate a WCAG 2.0 error message; use with messages about parsing problems that may cause inconsistent presentations or interpretations of the page (New v11.0111)

NOTE: Use only zero or one of these flags: 32, 64, 128, 32768, 65536, 131072

msgid - a unique number (no two messages should have the same msgid number) so that the message can be individually disabled or its message type changed using the message ID feature; flag 4 must be used if supplying a msgid (New v5.4930)

messagetype - the type of message to display

$MSGBOX_INFORMATION - displays a standard windows information dialog box on the display

$MSGBOX_ERROR - displays a standard windows error dialog box on the display

$MSGBOX_WARNING - displays a standard windows warning dialog box on the display

$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

$MSG_WARNING - adds a warning message to the message output of the validator

$MSG_COMMENT - adds a comment message to the message output of the validator

$MSG_MESSAGE - adds a general message to the message output of the validator

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 $MSGBOX_*.

Return value ("out flags"; the default is 0) (valid if if messagetype is not $MSGBOX_YESNOQUESTION) (New v10.9920)

1 - message was canceled (trashed) due to configuration settings like the message ID config

2 - message was canceled due to an exact text match to a disabled message in the message ID config (flag 1 should be set also)

This is a change from versions prior to 10.9920, where the default return value was 1, and it didn't mean anything (unless messagetype was $MSGBOX_YESNOQUESTION).

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, then 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 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, then a default error message is displayed if more than one of the listed attributes are used, if zero (0), then 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, then 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, then 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, then 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, then 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 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". Built-in tag name programs help to improve performance because the program is precompiled and can be written more efficiently.

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; as of v11.0111 also displays a WCAG 2.0 accessibility message if the alt text is empty or null and there is no "title" attribute (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", "go to", "image of", 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); also checks for common image file extensions like ".jpg" (New v7.9911)

7 - run for "alt" attributes to check for alt text longer more than 75 characters and to generate the appropriate accessibility messages if so (New v5.9910); also checks for alt text shorter than 8 characters (New v7.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 in an attribute or attribute value program for device-dependent event handler attributes like "onmouseout" and "onmouseover" and generate appropriate accessibility messages about using logical event handlers instead; added WCAG 2.0 messages in v11.0111 (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 the "accesskey" attribute program(s) to check for duplicate accesskey values (New v5.9910)

20 - run in the end validation program 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)

23 - run in tag name end programs (like for the "a" tag) to generate warning messages when the tag does not contain any text (special treatment for "a" tags: works only for "a" tags with the "href" attribute and that don't contain tags like "img") (New v6.4930)

24 - run in tag name programs to check attribute values (for attributes like "width", "height", "hspace", and "vspace") for CSS length units and print an appropriate message if CSS length units are improperly used in HTML attribute values (New v6.4930)

25 - run in tag name programs to check for HTML 4 attributes incorrectly being used in XHTML documents (like the "for" and "event" attributes for the "script" element) (New v6.4930)

26 - run in attribute programs for attributes that contain scripts (such as event attributes like "onclick" and "onmouseover"); checks the attribute value for mismatched single or double quotes; as of v11.0111 also generates a message if the default scripting language was not specified, an HTML5 document is not assumed, and category 17 is active (New v6.4940)

27 - run for elements that may be in a form to check to see if the element has a "name" attribute value that may cause problems/conflicts with JavaScript, such as "action", "method", "name", "target", etc. (New v6.4940)

28 - run in the start validation program (New v6.4950)

29 - run in the end tag programs for elements that may only contain inline elements when the document is a strict or XHTML 1.1 document. NEW: Can also be run to check for non-phrasing content in the element (v10.9922). (New v6.5200)

30 - run in the end tag programs for elements that may only contain block elements when the document is a strict or XHTML 1.1 document. (New v6.5200)

31 - run in the "tabindex" attribute program(s) to check for duplicate tabindex values (New v6.5200)

32 - adds $value (excluding "#") to $internallinksarray and increments #numinternallinks if $value is not already in the array (New v4.5200)

33 - run in the "a" open program to check for an adjacent "a" tag with only whitespace between the current "a" tag and the adjacent "a" tag (accessibility checking) (New v6.5300)

34 - run in the "table" end tag to check the table structure by checking that each table row has the same number of cells (works even when "colspan" and "rowspan" attributes are used)

35 - run in the end validation program to check for block level elements contained in inline elements; runs if flag 28 or 30 is set; flag 30 is specific for finding block level elements contained in a "font" element (New v6.9931)

36 - run in the end tag program for empty tags like "br" and "img"; generates a warning message if the end tag for an empty element is encountered in an XHTML document (New v6.9941)

37 - add any refresh links contained in a meta refresh tag to the list of document links; in v8.9910 and above, also sets $runprogram37url to the link to refresh to (New v7.0005)

38 - run in the end validation program to generate warning messages for tags that don't contain text (phrasing content) but probably should (like "b", "i", "label", header tags, etc); also generates a message for empty "p" tags (New v7.9910)

39 - run in the end validation program to display a comment message that lists ignored CSS properties (if any) (New v7.9910)

40 - check the value of the "id" attribute for valid characters; generates special messages for values beginning with _asp, __asp, or underscores (New v7.9914)

41 - check image dimensions (if able) and spacer images and generate a message if actual image dimensions are different from that specified with the "height" and/or "width" attributes; in v9.0192+ generates a warning if one "height" or "width" attribute value is a percent and the other is not; in v9.9931+ also checks for spacer images if accessibility checking is enabled (New v8.9910)

42 - use in an end tag program to check the text contents of the element being closed for preceding and ending space characters (New v8.9910)

43 - run in "option" tag program to check the "value" attribute's value for a possible link to check with the link checker (New v8.9910)

44 - run in an attribute program to check the attribute value for tags and generate a warning if tags are found (New v9.0191)

45 - run in the end validation program to generate CLF 2.0 messages if CLF 2.0 checking is enabled (New v9.9910)

46 - run in the heading start tag programs (like "h1", "h2", etc) to check heading order; increments #numheadingused (New v9.9910)

47 - run to generate a CLF 2.0 header order error message if CLF 2.0 checking is enabled (called from programnum 46) (New v9.9910)

48 - run in the "html" end tag to check for CLF 2.0 issues if CLF 2.0 checking is enabled (New v9.9910)

49 - run in the "title" end tag to support CLF 2.0 checking, requires $gvi23temp (New v9.9910)

50 - run in the "html" start tag program to set some language variables if a language is specified (currently used only for CLF 2.0 support) (New v9.9910)

51 - run in the "body" start tag to do some color contrast checking; sets $bodybgcolor if "bgcolor" attribute used; (New v10.0145) if accessibility checking is on then also generates an error or warning message if a "body" color attribute is used without using all of the color attributes (New v9.9910)

52 - run in the end validation program to check for links that open in new windows if accessibility checking is on (New v9.9910)

60 - run for elements that are obsolete in HTML5; generates flag 121 messages (New v9.9913)

61 - run for elements that may contain attributes that are obsolete in HTML5; generates flag 122 messages; v10.9923+ also checks "embed" for namespace-less attribute names with uppercase characters; v11.0114 also checks for presentational attributes if WCAG 2.0 checking is enabled (New v9.9913)

62 - run for new HTML5 elements (elements newly added in HTML5) (New v9.9913)

63 - run for new HTML5 attributes (attributes newly added in HTML5); not necessary to run for attributes that are only used in new HTML5 elements because program 62 is run; generates HTML5 compatibility messages if flag 123 is set (New v9.9913)

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)

65 - run in attribute programs for "old" (HTML 4 or older) attributes that are set to new HTML5 values (internal use only: use flag 1 to generate an HTML5 compatibility message if flag 123 is set) (New v9.9914)

66 - check the alt and title text to see if they are the same and display a warning message if so (New v9.9933)

67 - run for elements that may contain attributes that are deprecated in HTML4; generates flag 9 messages for HTML4 transitional documents (New v10.0020)

70 - run for elements that are "labelable" (may be associated with a label) to add the element's "id" value to the labelableidarray array (New v9.9914)

71 - run in the end tag program to check to following: (New v9.9914)

that any IDs specified using the "for" attribute in "label" elements are existent (and labelable) IDs (#labelforattused must be defined)

that any IDs specified with the "form" attribute are form IDs (#formattused must be defined)

that any IDs specified using the "list" attribute in "input" elements are datalist IDs (#listattused must be defined)

72 - run in the tag name program for "input" to check that the used attributes apply based on the input type; before running this program, #inputtype should be set to a number that represents the input type

73 - run in the end tag program for "progress" (New v9.9914)

74 - run in the end tag program for "meter" (New v9.9914)

75 - run in the end validation program to generate additional WCAG 2.0 messages (New v9.9927)

76 - run for certain tags, like "img" and "input", to add links and new "user link comments" to the $links array for link checking (New v9.9927); if checking a securely delivered (via HTTPS) page and flag 126 is enabled, also checks the content links to see if they are insecure and generates a warning message if so (New v10.0046)

77 - run in the open tag name program for "table" tags to set $islayouttable based on whether the table appears to be a layout table (New v9.9930)

78 - run for elements like "link" and "script" to check (if flag 126 is enabled) any content links that may be insecure, and if so, generate warning messages if the insecure content is linked to from a page that is presumed to be securely delivered via HTTPS (New v10.0046)

79 - run in the start tag program for "a" to quickly set the following: #accesskeyindex, #altindex, #hrefindex, $hrefvalue, #idindex, #mailtohref, #nameindex, #onclickindex, #selectedindex; sets to 0: #nameidok; increments the following: #aaccesskeyused (if #accesskeyindex>0), #atagused, #mailtotipmsg (if #mailtohref==true), #selectedbodyusedmessage (if #selectedindex>0); adds the value of "href" (if exists) to the list of links; runs program 32 if the value of "href" appears to be an internal link (New v10.0210)

80 - sets #idattused based on whether $value is one of the array elements of the $idattusedarray (uses case-insensitive compares) (New v10.0210)

81 - run in the end tag program for "menu" to check the children to HTML5 spec (New v10.9923)

82 - run in the end tag program for "dl" to check the children to HTML5 spec (New v10.9923)

83 - run in the end tag program for "figure" to check the children (New v10.9923)

84 - run in an start tag, attribute or attribute value program to do the preparation that is needed to check the attribute's value for valid element ID references; if run in a start tag program, then #p84_attindex should be set with the attribute index  of the attribute whose value contains ID references (New v10.9926)

85 - for internal use only; do not use

86 - run in the "class" attribute program for additional checks on the value (New v11.0043)

87 - run in the end tag program for "table" to check the IDs of any "headers" attributes used in "td" or "th" elements (New v11.0103)

128 - program to handle validation modes (New v5.00)

256 - run in onConfigLoad() function (do not use; private use only) (New v5.00)

257 - run in onConfigLoad() function to set default flag descriptions (New v9.9910)

258 - like 256,  but for newer config files (>=201203050) (do not use; private use only) (New v11.0111)

512 - run for non-XHTML 1.1 and non-HTML 4.0x strict tags (New v5.02)

1024 - run for XHTML 1.0 strict, XHTML 1.1 and HTML 4.0x strict tags that may contain non-XHTML 1.0 strict, 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 end 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 start 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; generates a warning message if the contents of the tag does not begin with <!--; for inline scripts, generates a tip message to avoid them (New v10.0125); good to run for the "style" and "script" tag name end 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); as of v7.9910, displays a compatibility message for PNG images; as of v10.0032, displays a recommendation message for PNG images if ".gif" is found in the "src" attribute; as of v10.0146, displays an accessibility message if accessibility checking is enabled and ".gif" is found in the "src" attribute

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 v4.5091 and later: flags has been replaced with programnum.

Functionality change in CSE HTML Validator 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 (includes style flags)

9 - CSECFGVALFLAGS2

10 - CSECFGTIDYFLAGS

11 - CSECFGNSGMLSFLAGS

12 - CSECFGPHPFLAGS (New v8.9910)

13 - CSECFGJSFLAGS (New v8.9910)

14 - CSECFGSEARCHENGINEFLAGS (New v8.9910)

15 - CSECFGVALFLAGS3

16 - CSECFGJSLINTFLAGS (New v10.9931)

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)

70 - "\Validator\CSSCheckerFlags" (style flags 600-629), flag ignored, set all flags at once (New v6.4930)

71 - "\Validator\CSSCheckerFlags2" (style flags 630-659), flag ignored, set all flags at once (New v6.4930)

200 - CSERESULTSTATUSFLAGS (New v4.5000)

300 - Validator job flags (New v6.9941)

flag values

1 - disable CSE validation results (use in start validation program)

2 - ignore "cf" elements (those that begin with "cf") (New v8.01)

3 - PHP script detected in document (New v8.9910)

4 - JavaScript detected in document (New v8.9910)

5 - run nsgmls (New v10.9912)

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 v8.0, set up the core validator checkbox options in 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 core validator checkbox options in 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 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

2 - set an attribute flag (New v6.4950)

flag - further specifies which flag to set

1 - attribute value contains no character references so don't try to convert them

2 - don't check the case of the attribute name (New v7.9914)

arg1 - the attribute index

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 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[, int exp value2...]);

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; also see 8 (New v5.4930)

4 - sets the flag to use for the error message that is generated when a tag is an empty-element tag 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)

6 - sets valjobflags, value is ORed with valjobflags, for value (New v6.4930):

1 - standands compliant check - changes some functions to be more standards compliant

7 - set legacyflag, the flag that controls the display of legacy validator messages; when this flag is enabled, legacy messages are NOT displayed  (New v7.9910)

8 - sets doctypeflags to value; also see 3 (New v9.0201)

9 - sets whether the document is presumed to be requested securely (New v10.0046)

-1 - not set/unknown

0 - no (insecure request)

1 - yes (secure request)

20 - sets CSEJOBSUBTYPE

50 - adds a category ID for attributes NOT to display in lists of allowable attributes; use in the onConfigLoad() function; returns 0 (New v9.9921)

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.

In CSE HTML Validator v9.9922 and later, can specify multiple value integers. This makes sense for some valueidentifiers but not all.

int errorcode writeFile(string exp filename,
 string exp varname[, int exp flags]);

Writes the contents of varname to filename and returns errorcode. This function is useful for logging purposes. If varname is an array, then writes the entire array.

errorcode (return value)

1 - no error, but did not do anything because this function is not supported in the lite edition.

0 - normal operation (should have succeeded)

-1 - could not open filename

-2 - varname does not exist

flags

1 - append to the end of filename instead of overwriting it

2 - treat varname as the actual string to write and not as a variable name

It is most efficient to use this function in the end validation program to write a multi-line array (created using addValue()) to a file instead of writing each line to a file with multiple calls to writeFile()

New line characters are automatically appended to each line that is written to the file.

This function is implemented only in CSE HTML Validator v7.01 and later.