Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Basic Data Binding to Produce the XFA Form DOM
154
Supporting Template-Creator Stamps
Templates may include information that uniquely identifies their creator and when they were last
modified. XFA processing applications are required to respect this information as described in
“Tracking
and Controlling Templates Through Unique Identifiers” on page 401.
Basic Data Binding to Produce the XFA Form DOM
This section explains how data is bound to specific nodes within a Form DOM and how disconnects in
naming, types, and level are handled. This section describes data binding only for static forms, which are
forms that have a pre-defined number of subforms. Data binding for dynamic forms is described later in
the chapter
“Dynamic Forms” on page 259.
The reader is assumed to be familiar with the principles and vocabulary of XML, as set out in
Extensible
Markup Language (XML) 1.0
[XML]. The reader is also assumed to be familiar with the following concepts:
●
Overall principles of XFA processing of user data, as described in
“Creating, Updating, and Unloading a
Structure of an XFA form template, as described in
“Template Features for Designing Static Forms” on
SOM expressions (including scope matching), as described in
“Scripting Object Model” on page 81
●
●
About Data Binding
Within XFA applications the template is instantiated as a tree-structured set of nodes called the Template
Data Object Model (Template DOM). Similarly, user data is instantiated as a tree-structured set of nodes
called the XFA Data Object Model (XFA DOM). The XFA Data DOM is further subdivided into one or more
non-overlapping subtrees, with each subtree representing a record. Data binding is the process by which
nodes in the Data DOM (data nodes) representing one record are associated with nodes in the Template
DOM (data nodes). The result is a new DOM (the Form DOM) which embodies the association. Although
the content of the Form DOM is copied from the Data DOM, its structure (arrangement and hierarchy of
nodes) is based mainly upon the Template DOM.
Template
DOM
XML Form Template
XML
DOM
Form
DOM
XML
User’s XML Data
Data
DOM
Binding the Data DOM to the Template to produce the Form DOM
However under some circumstances a node is created in the Form DOM which does not match any
existing note in the Data DOM. When this happens, if there is a data description, the data description is
consulted to determine what structure the data would have had if it had been there. Then processing
proceeds as though all that structure was present in the Data DOM, except of course that the node(s)