Using template parameters

You can use MCS expressions to access the values of simple template parameters through either function expressions, or expression variables. The template body contains references to template parameters. Both attributes and element content can be parameterized.

You can use MCS expressions to access the values of simple template parameters through either function expressions, or expression variables. The template body contains references to template parameters. Both attributes and element content can be parameterized.

Function expressions

Function expressions are identified by names that consists of namespace prefix and local name, and have a structure and syntax similar to that used in XPath 2.0 functions, for example request:getParameter('id'). Refer to MCS function expressions for further information.

Expression variables

In a parameter declaration you can use the expressionVariable attribute to bind a simple parameter to an expression variable. Expression variables can be accessed from within a template expression using the XPath syntax %{$varName} where $ is a literal character, and varName is the name of a variable. For example, <a href="%{$varName}">Link text here</a>.

Controlling parameter evaluation

In both the template:simpleValue and the template:complexValue elements you can use the expressionMode attribute to control the way that MCS evaluates parameter values.

Related topics