XFA Specification
Chapter 3, Object Models in XFA
Scripting Object Model
90
them transparent because it is convenient to be able to insert or remove such second-class objects
without being forced to modify scripts.
Area Objects Are Always Transparent
Within the Template and Form DOMs there may be
area
objects. An area object is an object which groups
together other template objects when the form is being created or modified. It has no consequences at
run time, either for the server or client. For this reason areas are always transparent to SOM expressions
even if the areas have names.
Variables Objects Are Always Transparent
Also within the Template and Form DOMs, subform objects may have a child
variables
object. A
variables
object holds document variable objects, each of which is explicitly nameable. (See
“Document Variables” on page 294.)
The
variables
object itself is transparent, so that each document
variable appears in SOM expressions as though it was directly a child of the root subform. For example, the
following template defines a document variable called
CompanyName
(shown in
bold).
<xdp>
<template …>
<subform name="Receipt">
<variables>
<text name="CompanyName">AnyCo</text>
<float name="TaxRate">7.25</float>
</variables>
</subform>
</template>
</xdp>
Within a SOM expression the document variable
CompanyName
is referred to using the SOM expression:
$template.Receipt.CompanyName
The transparency of the
variables
object makes document variables easy to refer to within scripts when
using a more advanced type of SOM expression, as explained below in
“Relative References” on page 100
Other Transparent Objects
Transparent objects are quite common inside the Form and Template DOMs but otherwise are quite rare.
Indeed, the following example depicts the only place where potentially transparent objects can be found
outside of the Form and Template DOMs.
<xdp …>
<connectionSet …>
<wsdlConnection
…
>
… </wsdlConnection>
<xsdConnection
…
>
… </xsdConnection>
<xmlConnection
…
>
… </xmlConnection>
</connectionSet>
</xdp>
Reference by Class
There is a special syntax which can be used to reference all objects, whether they are transparent or not.
The syntax is
"#class"
, where
class
is the name of the object class. In most cases for objects which can be
expressed in XML the name of the object class is the same as the tag for the associated element. For
example, the second detail subform object in the template on
page 89