XFA Specification
Chapter 2, Template Features for Designing Static Forms
Extending XFA Templates
68
Example 2.13 “Rectangle1” obscures “TextField1”
<field name="TextField1" y="70.00mm" x="60.00mm" h="15.00mm" w="30.00mm">
<ui>
<textEdit>
</textEdit>
</ui>
</field>
<draw name="Rectangle1" y="70.00mm" x="60.00mm" h="15.00mm" w="30.00mm">
<value>
<rectangle>
<fill>
<color value="0,255,0"/>
</fill>
</rectangle>
</draw>
Extending XFA Templates
The XFA template grammar defines the
extras
and
desc
elements, which can be used to add
human-readable or machine-readable data to a template. These elements provide the same properties
with the following exceptions: the
extras
element may be named and may contain child
extras
elements. These elements differ in their intended use; however, they can both be used to extend XFA
templates.
Use of custom namespaces in the template grammar is not permitted because the XFA template grammar
is a standard for interactive forms. That is, an XFA document should cause the same behavior, regardless of
the XFA processing application that processes it.
Adding Custom Named and/or Nested Data to a Template (extras)
The
extras
element is used to add comments, metadata, or datatyped values to template subelements.
An
extras
element is named and may contain multiple child
extras
elements. The
extras
element is
intended for use by XFA processing applications to support custom features.
The data contained in
extras
elements is loaded into the Template and Form DOMs, which makes it
available to scripts. Because the type of the data is indicated in the markup the data is available to scripts
in its native format, not only as a string. (Unless it is enclosed in <text> in which case string is its native
format.)
See also the
“Template Specification”
description of the
extras
element.
Adding Metadata or Comments to a Template (desc)
The
desc
element is used to add comments, metadata, or other datatyped values to its parent element. It
may also be used to house information that supports custom features, as with the
extras
element.
Element comments represented in a
desc
element remain with the template throughout its life. In
contrast, XML comments in an XFA template are lost when the template is represented as a Data Object
Model. Such information may be used for debugging or may be used to store custom information.
Home Index Bookmark Pages
Pages: Home Index All Pages