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 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.
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>.
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.
immediate. MCS evaluates the parameter before the template definition is processed. If it includes an XML document, the content of the document is passed.
repeated. The value is not processed; instead the markup is passed to the template definition. The template definition uses that value each time that it is evaluated. If the value is the inclusion of an XML document, the inclusion markup is passed.
deferred. Included markup is passed to the template definition, but in this case the result becomes the value of the parameter so that if it is used again, it does not evaluate the markup again. Thus the XML document would only be retrieved once. If it was not used at all, then it would not be evaluated.