Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Creating, Updating, and Unloading a Basic XFA Data DOM
132
Data Values Containing Element Content
A
dataValue
node cannot be the ancestor of a data group, and therefore once an element is mapped to
a
dataValue
node, the descendent elements must also be mapped to
dataValue
nodes. For each
element enclosing element content within the document range, where the enclosing element is mapped
to a
dataValue
node, the data loader by default maps the element into a
dataValue
node as specified:
●
the
name
property of the data group is set to the local part of the element type (tag name) of the
element
the
value
property of the
dataValue
node is set to the ordered concatenation of all of its child
dataValue
node's
value
properties, excluding children that contain metadata (see
“Attributes” on
contains
property)
the
isNull
property of the
dataValue
node is set to 0 (even if all of its children have
isNull
set to
1)
●
●
Consider the following example with the element
stamp
:
<book>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<stamp>Ordered on <date><yr>2000</yr><mo>06</mo><day>23</day></date></stamp>
</book>
In the above example the element
date
encloses purely element content and would be mapped to a data
group based upon the rules for data groups (described in the next section); however, the enclosing
element
stamp
maps to a
dataValue
node and therefore the data loader maps the element
date
to a
dataValue
node so that the
stamp dataValue
node does not become the ancestor to a data group.
The result of mapping this XML data document is as follows:
[dataGroup (book)]
[dataValue (ISBN)
[dataValue (title)
[dataValue (stamp)
[dataValue ()
[dataValue (date)
[dataValue (yr)
[dataValue (MO)
[dataValue (day)
= "15536455"]
= "Introduction to XML"]
= "Ordered on 20000623"]
= "Ordered on "]
= "20000623"]
= "2000"]
= "06"]
= "23"]
Data Group Elements
An element that encloses only other elements and whitespace, and is not itself enclosed by a data value
element, is treated as a data group. For each such element the data loader by default maps the element
into a
dataGroup
node as follows:
●
the
name
property of the
dataGroup
node is set to the local part of the element type (tag name) of
the element
Consider the following XML data document:
<book>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<author>
<firstname>Charles</firstname>