For the given text content, parts surrounded with ${ and } are evaluated using the specified scripting engine. If no scripting language is specified, default one is used (see config element).

Syntax

<template language="script_language">
    body as text for templating
</template>

Attributes

Name Required Default Description
language no Default config language Specifies script language that will be used for evaluation of parts surrounded with ${ and }. Valid values are beanshell, javascript and groovy.

Example

<var-def name="content">
    <file path="textdata/products.txt"/>
</var-def>

<var-def name="changedContent">
    <template>
        ${sys.datetime("yyyy-MM-dd, HH:mm:ss")} ${sys.lf}
        ---------------------------------------------------- ${sys.lf}
        ${my.process(content.toString())}
    </template>
</var-def>

Templater uses some built-in constants, functions and some user-defined objects from variable context in order to produce desired content.