Chapter 1, Introduction to XML Forms Architecture (XFA)
XFA Specification
Major Components of an XFA Form: XFA Template and Data
21
when defining an invoice detail line, a template designer might set up fields
unitPrice
,
quantity
and
amount
. The calculation for
amount
would simply be
unitPrice*quantity
.
XFA-SOM would resolve the references by finding the correct instances of
unitPrice
and
quantity
in
the following situations:
If the instances of those field names are in other subforms
When there are multiple instances of those field names in the same subform
Because of the declarative nature of XFA Template, the largest use of scripting is for field calculations. A
field with such a script typically is protected against data entry, and instead gets its value from an
expression involving other fields. A field's calculation automatically fires whenever any field on which it
depends changes (those fields may, in turn, also have calculated values dependent on other fields, and so
on).
Similar to calculation, a field can have a validation script applied that validates the field's value, possibly
against built-in rules, other field values or database look-ups. Validations typically fire before significant
user-initiated events, such as saving the data.
Finally, scripts can be assigned to user actions, for example, such as when the user enters data and when
the user clicks on a field. Scripts can also be activated by events that occur behind the scenes, such as
assembling data to send to a web service.
Data
Typically, XFA variable content is the customer's XML data, matching the customer's schema. Data could
also come from a database, an HTTP POST response, a web service interaction, default data supplied by
the template or other source. Often, form data elements are plain text, but may also include rich text and
graphics.
XFA defines a data value to be an XFA name/value pair, where the value is plain or rich text, or a graphic.
Data values may contain nested data values. An XFA name is a string suitable for identifying an object. A
valid XFA name must be a valid XML name, as defined in [XML], with the additional restriction that it must
not contain a colon ( : ) character.
XFA also defines a data group: the provider of structure in the data. Data groups may contain data values
and other data groups. As stated above, the data is typically structured according to the customer's
schema; data values and data groups are represented as abstract structures, inferred from the customer's
data. The abstract structure helps the XFA processing application create an XFA form that reflects the
structure and content of the data. This process (called data binding) is described in the next section.
It is important to note that XFA doesn't have to treat the data as a read-only source of variable content.
Many forms-based workflows involve round-tripping: load the data into the template, edit or augment it,
and save out the modified data. XFA can be instructed to remain true to the data's original structure when
saving. When data values and groups are logically moved to match the structure of the template, the form
designer has an option as to whether saving the data will or will not reflect those moves.
While data is often authored via legacy applications or database queries, it can also be authored through
an interactive form filling applications, such as Acrobat version 6 and greater.
Home Index Bookmark Pages
Pages: Home Index All Pages