In the context of OpenSocial templates, expression refers to an evaluation of some data source that is embedded directly into a markup structure.
Expressions can be rendered in a template using a simple syntax:
${Expression}
Expressions may be embedded inside text nodes and attributes, but will not be honored by an implementing container if they are inside custom tags and attribute names—a subject we will explore later in this chapter.
In addition to basic data rendering, most standard arithmetic expressions and data comparison features can be applied to expressions:
Next Index: ${Index + 1}
The functionality of these expressions is based on a modified
version of the JSP expression language. Even though there are definitions
for these arithmetic and comparison features, some operators use an XML
escaped alternative for comparisons, such as when implementing
OpenSocial template os:If
statements.
These escaped versions are listed in Table 7-7.
By default, expressions are evaluated as escaped strings before they are inserted into the HTML document. Expressions are the basis for the majority of what we do with OpenSocial templates, so it’s crucial that you have a basic understanding of them.
18.117.231.15