Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Creating, Updating, and Unloading a Basic XFA Data DOM
131
By default the XFA processor does not load metadata (attribute values) into the Data DOM. However there
is an option to load them as described in
“The attributes Element” on page 366.
When this option is used
attributes may also be represented by
dataValue
nodes containing null values. As with elements, the
data description may specify
nullType
for an attribute. However the value of
nullType
can not be
xsi
for metadata. It must be one of
empty
or
exclude
. The following table shows how loading of metadata
is affected by
nullType
:
Input XML
title="A Book"
title=""
title=""
nullType
empty
exclude
empty
exclude
empty
value
"A Book"
""
""
""
isNull
0
1
0
1
The data description indicates that the attribute is
required but the attribute is not present in the XML data
document.
Although XFA is tolerant of null values, external constraints may bar them in particular contexts. For
example, within rich text (which is expressed as a fragment of XHTML) empty elements are legal but not
null values. XHTML, as defined in
[XHTML],
does not comprehend null values.
It is important to understand that null values are in almost all ways treated the same as non-null values. For
example, suppose that as a result of data binding a field in the Form DOM is bound to a node representing
a null value in the Data DOM. This binding has the same effect as a binding to a non-null value. If a value is
assigned to the field, that value propagates to the bound node in the Data DOM, and as a result the node
in the Data DOM is no longer marked as null. Or if a value is assigned to the node in the Data DOM, that
value propagates to the bound field in the Form DOM.
Null Data in Mixed Content
A data value may enclose a data value which in turn contains null data. For example, consider the
following example:
<book>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<desc>
Basic primer on <keyword xsi:nil="true"></keyword>XML technology.
</desc>
</book>
The result of mapping this XML data document is as follows:
[dataGroup (book)]
[dataValue (ISBN)
= "15536455"]
[dataValue (title)
= "Introduction to XML"]
[dataValue (desc)
= "Basic primer on XML technology."]
[dataValue ()
= "Basic primer on "]
[dataValue (keyword) = "" isNull="1" nullType="empty"]
[dataValue ()
= "XML technology."]