5.21.3 Defining variables
5.21.3.1 Creating new variable documents
Variables are defined by creating documents of type Variables, containing the part VariablesData.
Actually the only real requirement is the presence of the VariablesData part, so one could create other types of documents containing this part and use them for variable substitution.
5.21.3.2 Structure of the variable documents
The variables are specified in an XML format, which follows this structure:
<v:variables xmlns:v="http://outerx.org/daisy/1.0#variables"> <v:variable name="var1">value 1</v:variable> <v:variable name="var2">value<strong>2</strong></v:variable> </v:variables>
As you can see in the example, variable values can contain mixed content.
The editor will validate the well-formedness and structure of the XML upon saving. When the content of the part is empty (= typcially when creating a new document), some sample XML is inserted to get you started.
5.21.3.3 Editing existing variable documents
If you want to edit the variables in use in the current site, you can use Tools -> Variables to get an overview of the active variable documents.
5.21.3.4 If a variable document is invalid
If during document publishing, a variable document cannot be loaded (e.g. due to invalid XML), no exception will be thrown, rather the variables defined in that document will not be available and an error will be logged to the repository log file.
5.21.3.5 Staging / live mode
Depending on whether the site is in staging or live mode, either the last or live versions of the variable documents will be used.
5.21.3.6 Permissions on the variables documents
The variable documents are filtered based on the read rights of the current user on the document. In staging mode, read access to non-live versions is required.
Previous