How do I configure HTML Validator to accept only certain strings for attribute values?
CSE HTML Validator Professional v4.0 and above can do this (but not the standard or lite editions because they lack the Configuration Editor). In this example, the “class” attribute will be checked for certain values, and a warning will be displayed if the value is not in the list. To do this, add the following code to the beginning of the attribute program for “class (124)” using the Programs tab of the Configuration Editor. Make sure that you select the Attribute program radio button and check Enable attribute program in the Programs tab. #index=getAttIndex(“class”); if ( matchCase(getAttValue($index), “classname1”, “classname2”, “classname3”)==0 ) { Message(1, $MSG_WARNING, ‘The “‘ + getAttName($index) + ‘” attribute has a questionable value.