Reference - Expressions
An expression in a template can occur either as the value of an attribute of a template tag or inside static text enclosed: Inside attributes of template tags, e.g. the match attribute of the <template> tag or the select attribute of a , which must evaluate to a node set, return the <template> tag, the <template> tag, the . Suppose you have the following model (which is always an xml file):
<model> <entity name="product" stereotype="persistent"> ... </entity> <entity name="customer" stereotype="persistent"> ... </entity> </model>A simple template to generate a Java class for each persistent entity might look like this:
<templates> <template match="entity[stereotype == 'persistent']" file="src/com/aperto/foo/${className()}"> ... </template> </templates>