Table of Contents
More Resources
Setting Global Variables

You should use global variables for any static content (located on the cover page, header, or footer) so that it will be translated appropriately if you are publishing content in multiple languages.
You have added a reference to a variable in your custom-xsl.xsl file, either by editing the header or footer template.

You want to define global variables to display custom text so that they will translate appropriately.

  1. Create a new file called en.xml located in your cfg/common/vars folder within your custom plugin. It should have the following contents to start:

    Step Information
    < ?xml version="1.0" encoding="UTF-8"?>  < vars xmlns="">        < !-- Add custom variable nodes here -->     < /vars> 
  2. Below is the basic form of a variable. Everything is wrapped in a < variable> element and the content within that can have < param> elements that correspond to values passed in when the insertVariable template is called.

    Step Information
    < variable id="[]">    [desired.text.content] < /variable> 
    < variable id="Custom Page Number">    Page < param ref-name="pagenum"/>  < /variable> 
  3. If you arrived here from the Editing a Footer Template guide, you’ll also need to declare the “Custom Footer Text” variable. Add the following code to the top of the en.xml file:

    Step Information
    < variable id="Custom Footer Text"> 
    < /variable> 

You have set up your required variables. Be sure to also set the values in any other languages by creating and editing xml files with names corresponding to the languages (de.xml, fr.xml, etc). You can see examples in org.dita.pdf2/cfg/common/vars/.