Setting up document templates

Top  Previous  Next

Document templates are portions of a document which can be created off-line, and inserted into the document in the application program. Document templates are XCICS resources, which you define using DOCTEMPLATE definitions in the XCICS configuration file; the name of the template is specified in the TEMPLATENAME attribute.

Templates can contain static data, and symbols whose values are inserted into the template when you issue the DOCUMENT CREATE or DOCUMENT INSERT command. The values to be subsituted are specified in the application program; they are associated with a particular document and cannot be used in a different document.

Templates can be retrieved from common files on the UNIX/Linux or Windows files system.

Declaring doctemplates in the configuration file

DOCTEMPLATEs must be declared in the XCICS configuration file, with the "define doctemplate" statement. For each document template you must provide:

the name
the full path of the file containing the document template

Example (UNIX/Linux):

define doctemplate        name=MAIN, type=file, path=$HOME/doctemplates/main.html;

Example (Windows):

define doctemplate        name=HOMEPAGE, type=file, path="C:\home\doctemplates\home_page.html";