20
Source Set Specification
The Source Set Data Object Model (DOM) provides a centralized mechanism for specifying connections
between XFA applications and Microsoft® ActiveX® Data Objects (ADO) acting as data sources and/or sinks.
Most of the time ADO is used to connect to databases, although in principle it can be used for other things.
The connection information may be specified in XML format and passively loaded at the start of
processing. However the Source Set DOM also supports a scripting interface which allows user-supplied
scripts to initiate and control ADO transactions.
In order to use the Source Set DOM it is necessary to understand the Microsoft® ADO model. XFA supports
version 2.6 of the ADO Application Programming Interface (API). There is a close correlation between the
ADO API and the structure of the Source Set DOM. The ADO API is defined in
[ADO].
The actual location of the source set document is variable. XFA provides a convenient mechanism for
packaging XML data (“XDP
Specification” on page 785),
which might be used to bundle source set
information with the template and other relevant material. However, XFA applications are free to use
scripting instead of or in addition to XDP.
Support for ADO is optional for XFA processors. This is necessarily so because ADO is platform-dependent
while XFA is a platform-independent standard.
The names used for nodes in the Source Set DOM are taken directly from the ADO API, as defined in
[ADO].
The Source Set Data Object Model
The Source Set Data Object Model (Source Set DOM) encapsulates the XFA source set information and
provides standard interfaces to it. The Source Set DOM contains data objects organized in a tree structure.
The source set tree is itself a branch within a larger XFA tree.
The
sourceSet
element and the standard contents shown below must belong to the namespace
http://www.xfa.org/schema/xfa-source-set/1.0/
which is known as the source set
namespace. Custom elements may belong to the source set namespace but are not required to.
Defaults
Many of the elements and attributes in the source set DOM have default values defined. When the
application loads the source set document, where an element or attribute has been omitted, the
application inserts the default value. The defaults appear as nodes in the source set DOM, just as though
they had been loaded from the source set document.
Scripting Interface
The Source Set DOM is part of a larger tree that holds all exposed XFA objects. The single large tree makes
it possible to refer to XFA objects using a unified format known as a Scripting Object Model (SOM)
expression. The grammar of SOM expressions is described in
“Scripting Object Model” on page 81.
Briefly,
an expression consists of a sequence of node names separated by periods (“.” characters). Starting from
some point in the XFA tree, each successive name identifies which child of the current node to descend to.
The root of the Source Set DOM is a child of the root
xfa
node. Hence, the
sourceSet
node itself is
755
Home Index Bookmark Pages
Pages: Home Index All Pages