XFA Specification
Chapter 6, Template Features for Designing Forms with Repeating Sections
Forms with Repeated Fields or Subforms
212
What if the data is not divided up into data groups? Suppose the data is in a flat stream of elements as
follows.
Example 6.21 Membership data with two classes, flattened
<template ...>
<subform name="Members">
<field name="Date" ...>...</field>
<field name="First" ...>...</field>
<field name="Last" ...>...</field>
<field name="First" ...>...</field>
<field name="Last" ...>...</field>
<field name="First" ...>...</field>
<field name="Last" ...>...</field>
</subform>
</subform>
</template>
The XFA configuration options allow for grouping transformations which operate when loading data into
the Data DOM. The effect of a grouping transformation is to collect sets of related data values into data
groups. This makes it possible to process flat data in record mode. See
“The groupParent Element” on
page 372
Globals
In record mode most bindings are constrained to bind a child of the record subform with a child of the
record data group. This is appropriate most of the time. However sometimes it is desired to reuse
particular data values at different places throughout a form. This can be done using global data. Global
data is any data value which is outside of any record and at the same level as or higher level than the
record data groups. For example, consider the purchase order data with records corresponding to
Detail
subforms. With this record definition, all of the data values that are not inside
Detail
data groups are
global.
Global data can only bind to global fields. A global field is a field with a
match
attribute of
global
. Global
fields are used for data which is only present in the data once but is presented multiple places in the form.
For example, in a multi-page form it is common for a name or other identifier to be entered on the first
page and reproduced on every page. The matching rules for globals are different from regular fields in
order to support this usage. If a global field in the Form DOM can not be matched directly, a match is
sought among global data values. This applies even if the binding process did not start at the root of the
Data DOM, as in an incremental merge. For example, suppose the template is as follows.
Example 6.22 Global fields in a registration form
<template name="Registration">
<subform name="registration">
<subform name="name">
<field name="first"><bind match="global"/> ... </field>
<field name="last"><bind match="global"/> ... </field>
</subform>
<subform name="address">
<field name="first"><bind match="global"/> ... </field>
<field name="last"><bind match="global"/> ... </field>
<field name="apt" ...> ... </field>
<field name="street" ...> ... </field>
<field name="city"...> ... </field>