Attribute Values

An attribute value can be enclosed between single quotes (') or backticks (`). In such a case, only character escaping is performed on it; and the special characters are the quote or the backtick and the backslash (\).

An attribute value can also be enclosed between double quotes ("). In such a case, both character escaping and variables expansion are performed on it; and the special characters are /, ", {, } and $.

Attribute values can be unquoted if they do not contain space characters.

Character Escaping

To preserve the literal value of a special character (\ and depending on the context /, ", {, }, $, ' or `), precede it with a backslash \ character.

Variables Expansion

Parts of the attribute value string that are of the form $VARNAME are substituted with the actual value of variable VARNAME. If VARNAME is not declared, it is replaced by an empty string. The variable name must be enclosed between braces as in ${VARNAME} if the characters following it may be considered as part of the name.

Example 7-1. Variable Expansion Example

If variable DOCUMENT_NAME is set to test.shtml and variable REMOTE_PORT is set to 12345, then the directive:

   <!-- #set var="Foo" value="${DOCUMENT_NAME}_$REMOTE_PORT" -->
will set the variable Foo to test.shtml_12345.