Previous Element | Next Element |
Template
This text element specifies FreeMarker template code to be
dynamically evaluated in-place at the current location.
Templates can be used to create both RVML document fragments
or text blocks and templates have full access to the entire
data model defined for the document.
A Template element is permitted anywhere within an RVML
document and can be specified either inline or as an
external resource. The output of a template can be RVML
(which can include recursive calls to the Template element)
or text. When the isXML attribute is 'true' the output of
the template is assumed to be XML and will be included in
the RVML document at the location of the Template element.
KineticFusion treats all XML templates as full XML documents
and each is parsed separately. If it is necessary to create
a sequence of RVML elements without a root element then the
hasRoot attribute should be set to 'false' and KineticFusion
will automatically wrap the XML with a 'root' root element -
this will be automatically discarded on processing.
Data model variables can also be defined locally for a
single Template element using the Variable child element.
These consist of simple name-value pairs. If a value is set
as a result of a Variable element, it is immediately
restored to its previous value after the execution of the
template.
Attributes
location | Optional attribute containing the physical location of the template document. This can be specified as either a file name of a URL (the type attribute is used to determine the location type). When a file is specified, it is assumed to be relative to the template root folder configured from the kinesis.templates.templateRoot . If a URL is specified it must be an absolute URL. | |
Type | String | |
type | The type of location specified in the location attribute. | |
Type | String | |
Values | file url | |
Default Value | file | |
isXML | Should the output of the template be interpreted as XML? | |
Type | Boolean | |
Values |
| |
Default Value | true | |
hasRoot | Does the XML fragment have a single root element? For XML output only. | |
Type | Boolean | |
Values |
| |
Default Value | true | |
encoding | The file encoding for an external template file. | |
Type | String | |
Default Value | The value specified by kinesis.templates.defaultEncoding | |
locale | The locale to be used when evaluating locale-specific template operations | |
Type | String | |
Default Value | The value specified by kinesis.templates.defaultLocale |
Child Elements
None
Parent Elements
None
Examples
None
Previous Element | Next Element |