XFA Specification
Chapter 3, Object Models in XFA
Document Object Models
73
Properties vs. Children
The W3C XML DOM specification
[XMLDOM2]
distinguishes elements, attributes, and content. In other
words a DOM constructed in accordance with
[XMLDOM2]
simply echoes the XML infoset. By contrast XFA
DOMs distinguish between
properties
and
children.
Properties
Properties are nodes that are automatically present in the DOM even if they are missing from the XML. For
example, a
subform
node in the Template DOM always has beneath it a
bind
property node, whether or
not the XML from which it was loaded included a
bind
element. If there is no
bind
element in the XML
then at load time the
bind
property node is created with default values.
Some properties are represented by elements, others by attributes. Property attributes are restricted by
the rules of XML to be singly-occurring and placed within their respective start tags. Property elements
can physically occur more than once per parent, but in every case the number of occurrences is restricted
by the DOM. For example, there can only be one
bind
property node per
subform
parent node, hence
only one
bind
element per enclosing
subform
element. Most properties are restricted to a single
occurrence. In addition, properties represented by elements may themselves have subproperties. For
example the
bind
property has
match
, and
ref
subproperties. However there is no logical distinction
between element and attribute properties at the DOM level.
The order of occurrence of different properties within the same enclosing element is not significant. For
those few properties that are multiply-occurring, the order of occurrence with respect to each other is
significant, but not the order of occurrence with respect to other properties. In the terminology used by
the RELAX schema language
[RELAX-NG],
properties can
interleave.
For example, consider the following fragment of XML:
<subform name="book">
<bind match="dataRef" dataRef="$record.manual" />
</subform>
When the fragment is loaded into the Template DOM the result is as follows:
subform
properties
of the
subform
name
“book”
bind
subproperties
of the
subform
lock
“0”
match
“dataRef”
ref
“$record.manual”
Properties in a DOM
Note that this does not show all of the properties of a subform. There are many.
The following XML fragment produces exactly the same result:
<subform name="book">
Home Index Bookmark Pages
Pages: Home Index All Pages