The value for an attribute must be of the same type as the declared value for the attribute. For example the NAME-attributes must have values starting with a name start character and followed by a name character. If the attribute has a different value an error has occurred and an error message is given.
do_check() checks if str is conform the requirements for the attribute value. Most of the attribute values have a different requirement for the first character then for the rest of the value. first_ok refers to a procedure which checks the first character of str, tail_ok checks the remaining characters. For example: for a NAME-attribute, first_ok is the procedure is_name_start_character() and tail_ok is the procedure is_name_character().
check_list() checks if all the values in the list str satisfy the attribute specification. check_string contains the procedure to check a single value. nm_tokens indicates the number of values in the value list. The type of error, for instance ``there is a non-name character encountered'', is specified in error_nr.
The values in the value list are separated by blanks. The blanks are tabs, spaces, record-start and record-end. To check all the values in the list the blanks must be skipped, this is done by Skip_s().
All these procedures check if the value of an attribute is conform the specification of its declared value. For declared value ENUMERATE and NOTATION, this means the value must be in their range.
The normalized length of an attribute value is needed to determine the ATTSPLEN quantity (page 27, section 7.9.4.5). The normalized length is the NORMSEP quantity plus:
- for an idref, name name token, number and number token list the sum of the number of characters for each token in the list, plus the NORMSEP quantity for each token in the list. This also holds when there is only one token in the list. - for all the others, the number of characters in the value plus the NORMSEP quantity for each reference to a CDATA or SDATA entity.The RS and Ee character may not be part of an attribute value literal. The SEPCHAR and RE character must be changed to a SPACE character. All other characters are stay the same.