With these commands it is possible to create templates representing conditional input for table cells, depending on defined conditions. Templates and the elements they are called from (Call template and XSL code frames) do not necessarily have to be part of tables but can also be independent elements placed outside the actual working sheet.
In the XSLfast tutorial there is an example for this in 06_Template but you can also create your own table to use templates.
This is a simple example for the use of a template: You define the condition that every time a product is made by one of three specified manufacturers, his logo should be displayed and XSLfast is supposed to pick the correct logo template. You create the templates outside the table as small independent elements; in this case they are static image frames showing the respective logo in the size you determine. Then declare them as templates by clicking the check box Generate Template for each and giving them names, e.g. "Leitz", "Edding" and "Pelikan".
Attention: Make sure the templates are not placed absolutely.
There are two ways to call templates in your document. The first one offers more control possibilities by far but requires XSL skills:
1. Create an XSL frame (where the template should be displayed later) with XSL code in it, e.g.
<!-- choose the logo of the manufacturer -->
<xsl:choose>
<xsl:when test="contains (ManufacturerName, 'Leitz')">
<xsl:call-template name="Leitz"/>
</xsl:when>
<xsl:when test="contains (ManufacturerName, 'Pelikan')">
<xsl:call-template name="Pelikan"/>
</xsl:when>
<xsl:when test="contains (ManufacturerName, 'Edding')">
<xsl:call-template name="Edding"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
Your working sheet now could look like this:

The templates can be placed completely outside the working sheet.
An exemplary PDF file could now look like this:

Every time the manufacturer is one of the three manufacturers you specified before, his logo is displayed.
2. A fast and simple way but with limitations: Open a "Call
template" frame in the table cell with this button
.

On double click the frame switches to selection mode.

In the select box all existing templates for this layout are listed. Select the template you want to display in the frame. The template will be displayed in the Call template element after processing the layout.
Attention: If you choose this method, it is not possible to define a condition on which the template will be called as it is in method 1 (if the condition is matched, display the correct template - if the condition is not matched, do not display the template etc.). In this option, the specified template is always called.
The layout we created the second way looks like this:

The same template is called every time.
Attention: As long as you do not activate the check box Generate Template belonging to the element, it cannot be used as a template.
Enter the name of the template in the field Template Name. This name is the name of the template itself.
In the field Template Parameter you have the chance to enter a parameter that can be addressed via the Call template function. The template selection dialog then shows the parameter for the template:

This is useful when the called template needs to evaluate a parameter for further processes. XSLfast also offers to define more than one parameter at the same time by offering a new empty entry field after each specification of a parameter value.
Please note: The menu items in the menu Call template are only available if you checked the check box Generate XSL-FO block.