The Variable element
The variable element allows you to set the variable contents (variable of the type “Custom Text”). Be aware that it does not create a variable if it does not exist in the master document, it only sets the content.
To create a variable in the master document:
Select Type, TextVariables, Define from the InDesign main menu.
In the Text Variables dialog click New.
Select the Custom Text type and enter a name that corresponds to the name value of your Find element in the XML.
A variable can be inserted by using the InsertVar element:
In this example, the value of the VAR_1 variable is set to “this is VAR_1”. In the content we use the “InsertVar” element to create a new variable called “VAR_3”. We then insert the variable “VAR_1”. Then we insert the “VAR_3”. Then we insert the variable “VAR_X”, which corresponds to a variable of the type “Creation date” in the master. And finally we create a new variable called “VAR_X1” and set the value of that variable to “test”. This would result in: