XFA Specification
Chapter 13, Dealing with Data in Different XML Formats
Extended Mapping Rules
397
[dataValue (title)
= "Introduction to XML"]
[dataValue (desc)
= "Primer on XML technology."]
[dataValue ()
= "Primer on "]
[dataValue (keyword) = "XML"]
[dataValue ()
= " technology."]
In the following example two different transforms are defined,
rtrim
for one element and
ltrim
for the
other.
<transform ref="desc">
<whitespace>rtrim</whitespace>
</transform>
<transform ref="keyword">
<whitespace>ltrim</whitespace>
</transform>
In the XML data document an element that is nominated for
rtrim
encloses an element nominated for
ltrim
.
<desc>Primer on<keyword> XML </keyword> </desc>
The result is that the inner element is first subject to
ltrim
on its own, and then to
rtrim
as content of
the outer element. Hence the value of the inner element starts off as
" XML "
, is trimmed on the left to
become
"XML "
, and then trimmed on the right as part of the string
"Primer on XML "
, resulting finally
in:
[dataValue (desc) = "Primer onXML"]
[dataValue (keyword) = "XML"]
The xfa:dataNode Attribute
This specification provides an extended mapping rule that can be used to force the creation of
dataValue
nodes and
dataGroup
nodes from a particular element within the document range. For
instance, this is useful in circumstances where the structure of the original XML data document is not
considered to be useful information; only the data value content is desired.
Unlike all the other extended mapping rules, this rule is invoked from within the XML data document. The
rule may be invoked for any element within the document range by placing a particular attribute in the
element. The name of the attribute is
dataNode
and it must belong to the namespace
"http://www.xfa.org/schema/xfa-data/1.0/"
. The attribute is defined as:
dataNode="dataValue"|"dataGroup"
where:
dataNode value
dataValue
dataGroup
Directs the data loader to …
Map the associated element to a
dataValue
node according the rules
defined by this specification.
Map the associated element to a
dataGroup
node according the rules
defined by this specification.
The data loader does not permit this extended mapping rule to be used to violate the relationships
between
dataGroup
nodes and
dataValue
nodes, as described by this specification. For instance, as a
result of a forced mapping of an element to a
dataValue
node, the element's contained elements are not
considered as candidate data groups, because
dataValue
nodes can be ancestors only to other
Home Index Bookmark Pages
Pages: Home Index All Pages