XFA Specification
Chapter 13, Dealing with Data in Different XML Formats
Extended Mapping Rules
392
[dataValue (customername) = "Delta Books"]
[dataValue (customerorder) = "300179"]
[dataGroup (bookitem)]
[dataValue (ISBN) = "15536455"]
[dataValue (title) = "Introduction to XML"]
[dataGroup (author)]
[dataValue (firstname) = "Charles"]
[dataValue (lastname) = "Porter"]
[dataValue (quantity)
= "1"]
[dataValue (unitprice)
= "25.00"]
[dataValue (discount)
= ".40"]
[dataGroup (musicitem)]
[dataValue (cdid)
= "4344-31020-2"]
[dataValue (title)
= "Big Calm"]
[dataValue (artist)
= "Morcheeba"]
[dataValue (quantity) = "1"]
[dataValue (unitprice) = "19.00"]
The rename Element
This section describes an extended mapping rule that can be used to cause the substitution of new names
for names of elements from the XML data document. This substitution affects the XFA Data DOM but does
not affect the XML data DOM.
By default, as described in
“Default Data Mapping Rules” on page 121,
the data loader copies the local
parts of element-types from elements into the corresponding
name
properties of nodes in the Data DOM.
This extended mapping rule provides for an alternate behavior in which the local (non-namespace) part of
each element type is matched against a set of (name, substitute) pairs and, if it is in the set, the substitute
string is copied into the
name
property of the node in its place. Matching is case-sensitive in keeping with
XML norms. If the local part of the element type does not match any member of the set, it is used verbatim,
as in the default case.
The XFA Configuration DOM may include one or more
transform
elements, each of which may include
one
rename
elements that override the default behavior. See
“Config Specification” on page 676
for the
full schema. The behavior specified by the
rename
overrides the default behavior for every element in the
XML data document with the local part of the element type matching the
ref
property of the
transform
. It also overrides the default behavior for every attribute in the XML data document with the
local part of the name matching the
ref
property of the
transform
, when attributes are being mapped
to
dataValue
nodes as described in
“The attributes Element” on page 366.
If the
rename
element is non-empty, the data loader sets the
name
property of the corresponding node in
the XFA Data DOM to the content of the
rename
element. The content of the
rename
element must be a
valid local name as specified by [XMLNAMES].
Note that name mapping only applies to the local part of a name. It is not affected by and does not affect
namespace designators.
Consider the following XML data document:
<item>
<book>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<author>
<firstname>Charles</firstname>
Home Index Bookmark Pages
Pages: Home Index All Pages