Frames 

 No Frames

Previous Element
TabIndex

Next Element
Text


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.
TypeString
type The type of location specified in the location attribute.
TypeString
Valuesfile
url
Default Valuefile
isXML Should the output of the template be interpreted as XML?
TypeBoolean
Values
true
The text output of the template should be treated as an RVML document fragment. Use the hasRoot attribute to indicate whether the XML should be treated as a complete document or an XML fragment
false
The output of the templates is interpreted as inline text
Default Valuetrue
hasRoot Does the XML fragment have a single root element? For XML output only.
TypeBoolean
Values
true
The output is a well-formed XML document
false
The output is a collection of well-formed elements without a single document root. KineticFusion will automatically surround the text with a <root></root>
Default Valuetrue
encoding The file encoding for an external template file.
TypeString
Default Value The value specified by kinesis.templates.defaultEncoding
locale The locale to be used when evaluating locale-specific template operations
TypeString
Default Value The value specified by kinesis.templates.defaultLocale

Child Elements

None

Parent Elements

None

Examples

None


Previous Element
TabIndex

Next Element
Text