Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Creating, Updating, and Unloading a Basic XFA Data DOM
118
difference from the preceding example is the addition of a new
dataValue
node representing the
attribute:
Name
ISBN
title
desc
keyword
language
Value
"15536455"
"Introduction to XML"
"Basic primer on XML technology."
"XML"
"en-US"
Contains
data
data
data
data
metadata
In many cases it is useful to distinguish between a data value which is empty (zero-length) and a data
value which was never entered. For example, suppose a form has ten fields into which the user may enter
numbers. The form is required to calculate and display the average of the numbers in the fields. However,
the user enters only six numbers, leaving four fields null. If the calculation simply adds all ten fields
together and divides the result by ten, it will treat the four null fields as zeroes and get the wrong answer.
Instead it needs to count and sum just the non-null fields. The easiest way to do this is to use the
isNull
property of the
dataValue
node associated with each field.
dataGroup Nodes
A
dataGroup
node is an object in the XFA Data DOM that corresponds to an element holding other
elements (as opposed to character data) in an XML data document. Within the XFA Data DOM interior
nodes are usually
dataGroup
nodes. A
dataGroup
node may have other
dataGroup
nodes and/or
dataValue
nodes descended from it.
Some XML data documents enclose repeating sets of data, with the same or similar structure but with
different content. This specification refers to these repeating sets of data as
records.
Typically a record
holds the data from a single form instance. The outermost element of a record must map to a
dataGroup
node.
dataGroup
objects have the following properties, in addition to the common properties such as
name
:
Property
nullType
Description
Controls the manner in which null values are represented in XML representations for
data value nodes descended from this node.
dataGroup
nodes themselves do not
have any value, null or non-null, so this property has no effect on the
dataGroup
node itself. This property is present purely so it can be inherited by
dataValue
nodes which are children of the
dataGroup
node.
A Boolean variable which has the value true if and only if the
dataGroup
node
represents a record (that is if the nodes descending from it represent all the content
of a single record). Otherwise it has the value false. The actual representation of the
Boolean values true and false is language-dependent.
isRecord
In the following fragment of XML the element
book
represents a data group containing data values
ISBN
,
title
,
desc
, and
keyword
.
<book>
<ISBN>15536455</ISBN>
Home Index Bookmark Pages
Pages: Home Index All Pages