Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Creating, Updating, and Unloading a Basic XFA Data DOM
116
Also, SOM expressions recognize the short-form
"!"
as equivalent to "xfa.datasets." and "$data" as
equivalent to "xfa.datasets.data". Thus for example the
title
element above could also be referenced as
either "!data.book.title" or "$data.book.title".
dataValue Nodes
A
dataValue
node is an object in the XFA Data DOM that corresponds to an element holding character
data (and possibly other elements) in an XML data document. Within the XFA Data DOM leaf nodes are
usually
dataValue
nodes. A
dataValue
node can have other
dataValue
nodes descended from it but
it can not have any
dataGroup
nodes descended from it.
dataValue
nodes have the following properties:
Property
contains
contentType
Description
A string identifying the source of the data. The string is set to
metadata
if the
value
property originated from an XML attribute, but to
data
if it did not.
A string identifying the type of the data. By default this is set to the empty string
(""
). The empty string is interpreted as equivalent to
text/plain
. Note however
that the treatment of
text/plain
in XFA is more relaxed than that specified in
[RFC2046] for the MIMEtype
text/plain
. The difference is that in XFA the data
loader may recognize a line break signified by a newline character (U000A) without
an accompanying carriage-return character (U000D).
A Boolean flag which is true if and only if the value of the data is null. Note that there
is no simple way to detect null values other than by inspecting the
isNull
property, because the syntax defined by [XML
allows an element to be
explicitly declared null using the
xsi:nil
attribute even though the element
contains data. Hence, a data node may contain data yet
isNull
may be
1
. When
this occurs the correct behavior is to treat the value of the data node as null, on the
grounds that explicit markup should override an implicit property. However when
such a data node is unloaded to a new XML data document the value should be
written out along with the
xsi:nil
attribute so that round-tripping preserves the
original document as far as possible.
Records the manner in which a null value was represented in the XML data
document from which it was loaded, and controls how it will be represented in the
new XML data document when it is unloaded. This property takes one of three
values. The value
xsi
means that a null value is represented by an
xsi:nil
attribute as defined in
[XML Schema].
The value
empty
means that an empty value
is represented by an empty element. The value
exclude
means that an empty
value is represented by a missing element or attribute. Note that the first two values
(
xsi
and
empty
) are only available for data nodes representing elements. For data
nodes representing attributes the value of this property is always
exclude
.
A string of Unicode characters holding the data associated with the node. The string
may be of any length (including zero-length, that is empty). The string must not
include the character code NUL (U0000). Hence, NUL may be used as the string
terminator by XFA applications.
isNull
nullType
value
In the following fragment of XML, the elements
ISBN
,
title
,
desc
and
keyword
represent data values.
<book>
<ISBN>15536455</ISBN>