XFA Specification
Chapter 13, Dealing with Data in Different XML Formats
Extended Mapping Rules
369
ordering of attributes, apart from the previously stated requirement that attribute nodes precede content
nodes.
The same rules apply to attributes of elements containing mixed content. Consider the following XML data
document:
<book>
<desc class="textbook">Basic primer on <keyword
class="technical">XML</keyword> technology.</desc>
</book>
The result of the mapping is as follows:
[dataGroup (book)]
[dataValue (desc) = "Basic primer on XML technology."
[dataValue (class) = "textbook" contains="metadata"]
[dataValue () = "Basic primer on"]
[dataValue (keyword) = "XML"]
[dataValue (class) = "technical" contains="metadata"]
[dataValue () = " technology."]
Attributes of empty data value elements are processed via the same rules as other elements. Consider the
following XML data document:
<item>
<book>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<unitprice currency="USD">25.00</unitprice>
<desc language="en-US"/>
</book>
</item>
In the above example the empty
desc
element maps to a
dataValue
node and has a
language
attribute.
Assume the XFA Configuration DOM has an
attribute
element containing
preserve
. Given that empty
elements map to
dataValue
nodes, as described in section
“Data Values Containing Empty Elements” on
page 129,
the result of the mapping is as follows:
[dataGroup (item)]
[dataGroup (book)]
[dataValue (ISBN)
= "15536455"]
[dataValue (title)
= "Introduction to XML"
[dataValue (unitprice) = "25.00"]
[dataValue (currency) = "USD" contains="metadata"]
[dataValue (desc)
= ""]
[dataValue (language) = "en-US" contains="metadata"]
Null Values with Attributes
A data value may be loaded as a null value even when it has attributes. For example, consider the
following XML data document:
<item xsi:xmlns="http://www.w3.org/2000/10/XMLSchema-instance">
<book>
<desc language="en-US" xsi:nil="1"/>
</book>