# Attribute Values

If an attribute value is enclosed between single quotes, only character escaping is performed on it.

If an attribute value is enclosed between double quotes, both character escaping and variables expansion are performed on it.

## Character Escaping

To preserve the literal value of a special character (`\`, `"`, `'`, ``, `{`, `}` 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`.