Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Creating, Updating, and Unloading a Basic XFA Data DOM
130
[dataValue (ISBN)
[dataValue (title)
[dataValue (desc)
= "15536455"]
= "Introduction to XML"]
= "" isNull="1" nullType="empty"]
Data Values Representing Null Data
It is desirable to represent null values in XFA data documents in an unambiguous way so that data can
make round trips without introducing artifacts. The XML 1.0 specification
[XML1.0]does
not provide such a
mechanism. Instead a mechanism was defined in
[XML Schema].
XFA adopts the
xsi:nil
attribute
defined in XML Schema but extends it for greater flexibility. In XML Schema when the value of
xsi:nil
is
true
the element must be empty. In XFA the element may be non-empty even when the value of
xsi:nil
is
true
. XML Schema does not define any circumstance in which the value of
xsi:nil
may be
false
. XFA defines a value of
false
for
xsi:nil
to mean that the associated
dataValue
node is
non-null, even if the element is empty. Thus in XFA any element, empty or not, may have an attribute
xsi:nil
which explicitly states whether or not it is null. Note that
xsi:
here and throughout this
document stands for any namespace prefix which maps to the namespace
http://www.w3.org/2000/10/XMLSchema-instance
.
The default treatment of null values can be modified by a data description. A data description is a
separate XML document that carries information about the schema of the data, as described in
“Data
Description Specification” on page 746.
The data description may supply a non-default value for the
nullType
property of a particular element. The following table shows how loading is affected by
nullType
:
Input XML
<title>A Book</title>
nullType
empty
exclude
xsi
empty
exclude
xsi
empty
exclude
xsi
empty
exclude
xsi
empty
exclude
xsi
empty
exclude
xsi
empty
value
"A Book"
isNull
0
<title />
<title></title>
<title />
<title></title>
<title xsi:nil="false">A Book</title>
""
""
"A Book"
1
0
0
<title xsi:nil="false" />
<title xsi:nil="false"></title>
<title xsi:nil="true">A Book<title>
""
0
"A Book"
1
<title xsi:nil="true" />
<title xsi:nil="true"></title>
""
1
The data description indicates that the element is required
but the element is not present in the XML data document.
""
1
Note that the correct behavior is only defined for
xsi:nil
attributes with a value of
true
or
false
. The
data document must not contain
xsi:nil
attributes with other values.
Home Index Bookmark Pages
Pages: Home Index All Pages