XFA Specification
Chapter 13, Dealing with Data in Different XML Formats
Extended Mapping Rules
377
Similarly, in this database, each book can have only one ISBN and one title. However, a book can have any
number of authors. For example, given the following data:
<items>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<firstname>Charles</firstname>
<lastname>Porter</lastname>
<firstname>Elizabeth</firstname>
<lastname>Matthews</lastname>
<ISBN>15536456</ISBN>
<title>XML Power</title>
<firstname>John</firstname>
<lastname>Smith</lastname>
</items>
The result upon loading is:
[items]
[book]
[ISBN = "15536455"]
[title = "Introduction to XML"]
[author]
[firstname = "Charles"]
[lastname ="Porter"]
[author]
[firstname = "Elizabeth"]
[lastname ="Matthews"]
[book]
[ISBN = "15536456"]
[title = "XML Power"]
[author]
[firstname = "John"]
[lastname = "Smith"]
There is a limitation to the type of data that this transform can handle. The data must not contain nested
dataValue
nodes. (This implies that it must not contain rich text.) To deal with this use, the
dissolveStructure
option of the
presence
transform, described under
“The presence Element” on
page 383,
to ensure the data is flattened before the
groupParent
transform processes it.
The ifEmpty Element
This section describes an extended mapping rule that can be used to modify the handling of elements
that are empty in the XML data document. This handling affects the XFA Data DOM and may optionally
alter the XML data DOM.
By default, as described in
“Data Values Containing Empty Elements” on page 129,
the data loader
represents empty elements in the XML data document with
dataValue
nodes in the XFA Data DOM. This
extended mapping rule provides for alternate behaviors in which the
dataValue
node is removed from
the Data DOM(s) or is converted to a
dataGroup
node.
For purposes of this specification:
●
●
A
dataGroup
node is considered empty if and only if it has no children.
A
dataValue
node is considered empty if and only if it has no children and its
value
property is
equal to the empty string (
""
).