1.2. Templates

Templates are used for setting up parameter and attribute-set values different from default ones.

A template can be chosen by menu items New/Default template (chooses default template) or New/Choose template... (user chooses template in the file chooser dialog box).

The default template is saved in templates/template.xml file. User templates can be saved anywhere.

Both default and user templates must be defined according to the predefined template structure.

Structure of template

<template xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1
  <attribute-sets>2
    <attribute_set name="monospace.properties">3
      <attribute default="3.0in">start-indent</attribute>4
      <attribute default="4.0in">end-indent</attribute>
      <attribute default="bold">font-weight</attribute>
      <attribute default="center">text-align</attribute>
      <attribute default="3px solid red">border-bottom</attribute>
    </attribute-set>
  <attribute-sets>
  <parameters>5
    <parameter default="1">double.sided</parameter>6
    <parameter default="A4">paper.type</parameter>
  </parameters>
</template>
1

Tag template is a root element and can occur in the file only once. It contains one tag attribute_sets and one tag parameters.

2

Tag attribute_sets contains a list of attribute-sets (tags attribute-set).

3

Tag attribute_set represents an attribute-set with its attributes – contains list of attribute tags. Argument name specifies a name of attribute-set. Attribute-set must be defined in config.xml.

4

Tag attribute represents an attribute of attribute-set. The attribute is defined by its name and must be defined in attributes.xml and config.xml. Argument default specifies a new attribute value or values.

5

Tag parameters contains a list of parameters (tags parameter).

6

Tag parameter represents a parameter. The parameter is defined by its name and must be defined in config.xml. Argument default specifies a new parameter value.