These functions return 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)
•32 - URL decode (New v7.9914)
•65536 - remove preceding and trailing whitespace characters from string (New v5.9910)
•If flags specifies unknown flags or an error occurs, then 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 convertStringEx(int exp mode,
string exp string)
•mode - tells the function what to do to string
•1 - remove all non-alpha characters including whitespace
•2 - remove all non-alpha, non-digital characters including whitespace (New v9.9914)
•3 - try to extract a file extension from string and return it; else returns an empty string (New v10.0146)
•If mode is unknown or an error occurs, then the function will, in most cases, return string unmodified. It will not generate an error.
•This function is implemented only in CSE HTML Validator v8.00 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 index does not exist.
string getAttValue(int exp index)
string getAttValueForStartTag(int exp index[, int exp flags])
•Returns the attribute value of an attribute of the tag, specified by the attribute index 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 character references have been replaced with the actual characters.
•Generates an error if the attribute at index does not exist, because if the attribute doesn't exist, then it can't have a value.
•getAttValueForStartTag() is like getAttValue() but can also be used in an end tag program to get the attribute value of an attribute of the corresponding start tag, specified by the attribute index index; may require that runProgram(21) be used in the start tag name program (New v11.0112)
•optional flags for getAttValueForStartTag()
•4 - trim preceding and trailing spaces
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 character references have been replaced with the actual characters (in v11.0111+, this is the default if flag 1 or 2 is not set)
•2 - get the value before character references have been replaced with the actual characters
•4 - trim preceding and trailing spaces (New v11.0111)
•Generates an error if the attribute at index does not exist, because if the attribute doesn't exist, then it can't have a value.
•This function is implemented only in CSE HTML Validator v5.02 and later.
string getMessageCategory(int exp cat)
•Returns a category string specified by cat. If cat is invalid, then returns an empty string.
•cat
•24 - returns $HTML5COMPAT if available else "HTML5 Compatibility"
•32 - returns $NOATTRIBUTESCAT if available else "No Attributes" (New v11.0043)
•33 - returns $ASSUMEDDEFAULTSCAT if available else "Assumed Defaults" (New v11.0043)
•34 - returns $EXTRAWHITESPACECAT if available else "Extra Whitespace" (New v11.0043)
•35 - returns $PUSELESSCAT if available else "Useless or Possibly Useless" (New v11.0043)
•36 - returns $CSS3BEYONDCAT if available else "Beyond CSS3" (New v11.0043)
•37 - returns $CSSMULTIPLEDEFS if available else "Multiple Definitions" (New v11.0043)
•Not all possible values documented here
•This function is implemented only in CSE HTML Validator v10.0210 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, then 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, then getTagName() returns BoDy.
•The string keyword CurrentTagName is now recommended instead.
string getValueString(int exp valueidentifier)
•valueidentifier - tells the function which string value to return
•1 - the folder where HTML Validator is installed (ends with a \)
•2 - the folder 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 or URL (with full path if available) of the document 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're using HTML Validator's integrated editor, then this can be added from the 'Tags' menu or from the HTML 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; if a match is not found, then any even number of single quotes are converted to double quotes and the DOCTYPE is tested again (New 20111214). (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 (character references are 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); use 33 instead of 13 to including "{text}" for ASP and PHP code sections (New v9.9913); use 30 or 32 instead of 13 to include beginning and trailing space characters (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 "background-color" CSS 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)
•19 - similar to 14 but returns something like "XHTML 1.1", "HTML 4.01 Strict", "XHTML 1.0 Strict", etc. (New v6.4930)
•20 - if the "background" attribute is used then returns a string, starting with a space, asking to consider the "background-image" CSS property instead of the "background" attribute (New v6.9910)
•21 - if the "text" attribute is used then returns a string, starting with a space, asking to consider the "color" CSS property instead of the "text" attribute (New v6.9910)
•22 - if the "alink" attribute is used then returns a string, starting with a space, asking to consider the ":active" CSS pseudo-class instead of the "alink" attribute (New v6.9910)
•23 - if the "link" attribute is used then returns a string, starting with a space, asking to consider the ":link" CSS pseudo-class instead of the "link" attribute (New v6.9910)
•24 - if the "vlink" attribute is used then returns a string, starting with a space, asking to consider the ":visited" CSS pseudo-class instead of the "vlink" attribute (New v6.9910)
•25 - returns a recommendation not to use frames due to usability and search engine issues (New v7.9910)
•26 - returns a list of ignored CSS properties (if any) (New v7.9910)
•27 - returns, if set, a string with legacyflag in square brackets followed by a space; example: "[114] " if legacyflag has been set to 114 (New v7.9910)
•28 - returns a string of used accesskeys
•29 - returns a string of unused accesskeys
•30 - returns the text (character references are not converted) contained in the tag that is being closed, including beginning and trailing spaces; use in a tag close program only; to get the location of this text, call getLocation(3,0); use 13 instead of 30 to exclude beginning and trailing space characters; also see 32 (New v8.9910)
•31 - returns a string like " The color "darkgreen" is the same as "#006400" in HTML/CSS." for the color name (darkgreen in this example) stored in the variable $getvaluestring31colorname. If there is no value for $getvaluestring31colorname or the color name does not exist or is unknown, then returns an empty string (New v8.9910)
•32 - returns the text (character references are not converted) contained in the tag that is being closed, including beginning and trailing spaces and including "{text}" for ASP and PHP code sections; use in a tag close program only; to get the location of this text, call getLocation(3,0); see also 13 and 30 (New v8.9920)
•33 - like 13 but includes "{text}" for ASP and PHP code sections (New v9.9913)
•34 - if the "align" attribute is used then returns a string, starting with a space, asking to consider the appropriate CSS instead (New v9.9913)
•35 - return the file extension of the document being validated (or an empty string if not available), if available; also sets $getvaluestring35infileext to the extension (New v9.9921)
•36 - returns a string like " If this is a layout table, then include "layout" as part of the table's "id" attribute value and this message will not be displayed." (New v9.9930)
•37 - if the "hspace" attribute is used then returns a string, starting with a space, asking to consider the "margin", "margin-left", and "margin-right" CSS properties instead of the "hspace" attribute (New v10.0020)
•38 - if the "vspace" attribute is used then returns a string, starting with a space, asking to consider the "margin", "margin-top", and "margin-bottom" CSS properties instead of the "vspace" attribute (New v10.0020)
•39 - if the "border" attribute is used then returns a string, starting with a space, asking to consider the "border" CSS property instead of the "border" attribute (New v10.0020)
•40 - returns the file extension of the filename stored in $getvaluestring40input, returns an empty string if can't get a file extension (New v10.0032)
•41 - returns a message about HTML5's unfinished status (New v10.0044)
•42 - returns a valid default character encoding (like "utf-8", which is the default return encoding if none is specified elsewhere) to use in example messages; priority is given to valid encodings specified in any XML declaration, then in any "meta" tags, then in the HTTP headers (New v10.0127)
•43 - returns a string with a link to visit for help with web server charset configuration - like "Visit http://www.htmlvalidator.com/help.php?m=3&h=webservercharset for web server charset configuration help.". (New v10.0133)
•44 - returns a valid character encoding string if one has been specified in the XML declaration, in any "meta" tags, and then in the HTTP headers, else returns an empty string (New v10.0140)
•45 - returns a string about what attribute values must be quoted based on the document type (New v10.9914)
•46 - returns a string, beginning with "NOTE: " about potential issues with accesskeys (New v10.9916)
•120 - returns a comma-separated list of unique proprietary attributes that were used (like those starting with "x-") (New v11.01)
•121 - returns a comma-separated list of unique proprietary CSS pseudo-elements that were used (like pseudo-elements starting with "-moz-") (New v11.01)
•122 - returns a comma-separated list of unique proprietary CSS media features that were used (like media features starting with "-webkit-") (New v11.01)
•130 - returns a string like "(with class="classname", id="idname") " for a current tag with class="classname" and id="idname", or returns an empty string if those attributes are not used; also calls runProgram(21) (New v11.01)
•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 ended 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 - determine what to do
•If mode is 0 (the default), then returns str if num is 1, else returns str+"s"
•If mode is 1, then returns str+"y" if num is 1, else returns str+"ies"
•This function is implemented only in CSE HTML Validator v4.00 and later.
string replaceStringCase(string exp subject,
string exp search, string exp replace)
string replaceStringNoCase(string exp subject,
string exp search, string exp replace)
•Returns subject with all occurrences of search replaced by replace.
•replaceStringCase() performs a case-sensitive search while replaceStringNoCase() does not.
•This function is implemented only in CSE HTML Validator v10.9914 and later.
string toLower(string exp string)
•string - the string to convert to lowercase
•This function is implemented only in CSE HTML Validator v4.00 and later.
string toString(int exp convert)
•convert - the integer to convert to a string
string toStringF(float exp convert[, string format])
•convert - the 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 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 v4.00 and later.