XFA Specification
Chapter 13, Dealing with Data in Different XML Formats
Extended Mapping Rules
381
Alternatively
ignore
can be applied to the whole document as follows:
<transform ref="">
<ifEmpty>ignore</ifEmpty>
</transform>
and in this case the recursive deletion of all empty nodes results in the following mapping in the XFA Data
DOM:
[dataGroup (item)]
[dataGroup (book)]
[dataValue (title) = "Introduction to XML"]
With
remove
in place of
ignore
, the result of the mapping in the XFA Data DOM is the same in every case
as for
ignore
(above), but for every node deleted from the XFA Data DOM the corresponding node in the
XML data DOM is also deleted.
The nameAttr Element
Some XML data documents use the same element type for different families of elements, with an attribute
indicating the element family. This style of XML is referred to in the following paragraphs as
inverted
XML.
(Inverted is not meant pejoratively.) For example, a document that conventionally would contain:
<?xml version="1.0"?>
<directory>
<address>
<street>10 King</street>
</address>
</directory>
could be expressed in inverted XML as:
<?xml version="1.0"?>
<directory>
<item nodename="address">
<item nodename="street">10 King</item>
</item>
</directory>
This section describes an extended mapping rule that can be used to alter the handling of data expressed
as inverted XML. This affects the XFA Data DOM but has no effect on the XML data DOM.
By default, as described in
“Default Data Mapping Rules” on page 121,
the
name
property of each node in
the XFA Data DOM is copied from the local part of the element type of the corresponding element in the
XML data document. This extended mapping rule provides for behaviors in which the
name
property of a
nominated element is taken from the value of its nominated attribute.
The XFA Configuration DOM may include one or more
transform
elements, each of which may enclose a
nameAttr
element that overrides the default behavior. See
“Config Specification” on page 676
for the full
schema. The behavior specified by the
nameAttr
element overrides the default behavior for elements
matching the
ref
property of the
transform
element. For each such element that has an attribute with
the given name that has a non-empty value, the data loader copies the value of the nominated attribute
into the
name
property of the associated node in the XFA Data DOM. For such elements the data loader
does not load the nominated attribute as a
dataValue
node even when attribute loading is enabled, as
described in
“The attributes Element” on page 366;
this applies even if the attribute has an empty value.
Home Index Bookmark Pages
Pages: Home Index All Pages