XFA Specification
Chapter 3, Object Models in XFA
Scripting Object Model
82
About SOM Expressions
The XFA Scripting Object Model (SOM) is a model for referencing values, properties and methods within a
particular Document Object Model (DOM). A DOM structures objects and properties as a tree hierarchy.
XFA SOM expressions provide easy access to these objects and properties through a straightforward
object reference syntax. This syntax is described in detail later in this specification.
XFA SOM, in combination with a scripting environment, allows individuals to quickly and easily perform a
variety of functions without requiring extensive coding. Through the use of various notations, accessors,
and operating rules, XFA SOM defines ways to reference specific objects, groups of objects, or even objects
whose name is unknown but whose position within the tree is known.
XFA SOM interacts with any XFA-DOM, and may appear in a form template, XML data, configuration
information, or on the command line. It is the responsibility of a scripting environment to expose the
appropriate objects and properties to XFA SOM. As such, referencing unexposed objects or properties is
not possible.
The SOM examples used throughout this document (XFA
Specification)
reflect the properties and methods
described in
Adobe XML Form Object Model Reference
[FOM].
It is recommended that XFA processing
applications adopt the same names and behaviors as those described in that reference, to ensure a
consistent behavior in forms used across a variety of XFA processing applications.
The Receipt Example
An XFA-DOM is structurally represented as a tree hierarchy with a single root object (or node) having a
potentially unlimited number of descendant objects (or nodes). For example, the data for a receipt has the
following form when expressed as an XML document:
<?xml version="1.0" encoding="UTF-8" ?>
<Receipt>
<Detail>
<Description>Giant Slingshot</Description>
<Units>1</Units>
<Unit_Price>250.00</Unit_Price>
<Total_Price>250.00</Total_Price>
</Detail>
<Detail>
<Description>Road Runner Bait, large bag</Description>
<Units>5</Units>
<Unit_Price>12.00</Unit_Price>
<Total_Price>60.00</Total_Price>
</Detail>
<Sub_Total>310.00</Sub_Total>
<Tax>24.80</Tax>
<Total_Price>334.80</Total_Price>
</Receipt>
The following diagram shows the tree for the receipt data as it is stored in the XFA Data DOM. Although the
distinction is not important here, data group nodes are shown in blue while data value nodes are shown in
green.
Home Index Bookmark Pages
Pages: Home Index All Pages