XFA Specification
Chapter 15, Template Specification
Template Reference
673
The variables element
An element to hold document variables.
<variables
Properties:
id="xml-id"
use="cdata"
usehref="cdata"
>
Children:
<boolean>
[0..n]
<date>
[0..n]
<dateTime>
[0..n]
<decimal>
[0..n]
<exData>
[0..n]
<float>
[0..n]
<image>
[0..n]
<integer>
[0..n]
<manifest>
[0..n]
<script>
[0..n]
<text>
[0..n]
<time>
[0..n]
</variables>
The variables element is used within the following other elements:
proto subform
Document variables are used to hold boilerplate which may be inserted conditionally under control of a
script, for example terms and conditions of a purchase agreement. Placing the boilerplate content into a
variables
element makes it accessible to scripts via the usual mechanism of SOM expressions.
The
variables
element can hold any number of separate data items. The data items can be any kind of
data. Each data item bears its own
name
attribute so they are individually addressable by scripts. In SOM
expressions, data items are directly under the subform. For example, if a subform is declared as:
<subform name="w">
<subform name="x">
<variables>
<integer name="foo">1234</integer>
<float name="bar">1.234</float>
</variables>
<field name="y">...</field>
</subform>
</subform>
then in the context of the subform named
w
, the variables are addressed by the SOM expressions
x.foo
and
x.bar
, while the field is addressed as
x.y
.