The template statement allows injecting an internal or external template, depending on the "file" attributes own syntax. the statement has a counterpart that is the template's value, once this content has been scanned again to eliminate any included DIML instruction. The scanning process is fully recursive until:
- No DIML statement remains in the content,
- the absolute, configuration overridable, nesting limit of the processor has not been reached.
file: Designates the template to be injected. This attribute has two syntaxes, wether the templates has been loaded into local memory or not. A template that has been defined in the same source file where this call is invoked is in local memory BEFORE the document is parsed. A template that is defined into another file is loaded into local memory, only if a template statement was previously invoked for this template, or after this template be imported.
A local template (syntax 1) is case sensitive.
An external template (syntax 2) invocation can be splitted in two parts. Before the anchor mark ("#"), the path to the file, that may be absolute or relative to the actual DIML file (absolute or relative path is system dependent).
iterate: This attribute indicates that the call is iterative, that is, the automated index mechanism will be activated. iteration is a non nul integer and will tell how much iteration must be processed. If the iterate attribute is omitted, the template invocation is done in a scalar way.
If the template is local, following equivalencies are valid:
<%template file="TEMPL" %> |
<%%TEMPL%%> |
<%template file="TEMPL" iterate=2 %> |
<%%TEMPL[2]%%> |
|