XFA Specification
Chapter 13, Dealing with Data in Different XML Formats
Extended Mapping Rules
367
Attributes may also be excluded from loading based on namespace (as described in
“The excludeNS
Element” on page 370).
The data loader does not load attributes with excluded namespaces regardless of
the value of the
attributes
element in the XFA Configuration DOM.
Apart from the above exclusions, the behavior specified by the XFA Configuration DOM overrides the
default behavior for the entire XML data document.
Assuming that this extended mapping rule has been invoked with
preserve
, the following sections
describes how the mapping occurs for attributes that are not excluded by the above rules.
Data Group Elements with Attributes
Consider the following XML data document:
<item xmlns:abc="http://www.example.org/abc/">
<book abc:status="stocked">
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
</book>
</item>
In the above example, the
book
element maps to a
dataGroup
node and has an
"abc:status"
attribute with a value of
stocked
.
The data loader maps each attribute of a data group element to
dataValue
nodes that are children of the
dataGroup
node as follows:
the
name
property of the
dataValue
node is set to the attribute name
the
namePrefix
property of the
dataValue
node is set to the namespace prefix of the attribute
name
the
xmlns
property of the
dataValue
node is set to the resolved namespace of the attribute name
the
value
property of the
dataValue
node is set to the attribute value
the
contains
property of the
dataValue
node is set to
metadata
The result of the mapping is as follows:
[dataGroup (item)]
[dataGroup (book)]
[dataValue (status) = "stocked" namePrefix="abc"
xmlns="http://www.example.org/abc/" contains="metadata"]
[dataValue (ISBN)
= "15536455"]
[dataValue (title) = "Introduction to XML"]
The data loader processes attributes prior to processing any content of the data group element. The effect
is that any
dataValue
nodes resulting from attributes appear as children of the
dataGroup
node before
(left of ) any children resulting from processing content of the data group. This is in keeping with the
general structure of the XFA Data DOM as described in
“About the XFA Data DOM” on page 114,
whereby
a top-down left-to-right traversal reproduces document order.
The set of
dataValue
nodes resulting from processing attributes are ordered in an
implementation-defined order. The XML specification [XML] states that by definition the order of
attributes is not meaningful. Hence there is no justification for imposing any attribute ordering restriction
upon the data loader. On the other hand applications using the XFA Data DOM must not rely on any
particular ordering of attributes, apart from the previously stated requirement that attribute nodes
precede content nodes.
Home Index Bookmark Pages
Pages: Home Index All Pages