Understanding the XML Form Object Model

A DOM is a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document. DOMs are commonly used with data expressed in XML.

All of the DOMs used in the XML Form Object Model share the following characteristics:

  • They are strictly tree-structured.

  • A node may have mandatory children. In such cases, the mandatory child nodes are created at the same time as their parent.

  • The non-mandatory children of each node in the tree are ordered by age. That is, the DOM is aware of the order in which the non-mandatory child nodes were added.

    For each step in the form processing, there is a DOM that holds the data structures for that stage. Scripts can examine and modify each DOM. DOMs are responsible for maintaining internal consistency but not external consistency. For instance, when a script turns on a radio button by assigning the corresponding field, all the other buttons coupled to that one are automatically turned off. This is a matter of internal consistency so it is managed by the Form DOM itself.

    By contrast, the Data DOM does nothing to prevent a script from violating the rules of XML, for instance, by giving an object two properties with the same name. This is a matter of external consistency so it is the responsibility of the script author, not the DOM.

    Each time a form design is combined with data, the XML Form Object Model is used to facilitate the process of combining template and data to create the resulting form. This process begins by using the existing XML DOMs’ representations of the form design and the XML data to create separate models. These separate models store a structured representation of the original form design and original XML data. The Template DOM corresponds to the form design, and the Data DOM corresponds to the user-supplied XML data.

    After the template and data models are created, a third model, the Form DOM, is created that represents the merged information. The Form DOM acts as a medium for combining the specific values from the XML data with the presentation rules defined by the form design.

    If you are creating an interactive form, after the form DOM is created, the form is complete and ready for deployment to users. Interactive form designs may have associated data that they are merged with, but most interactive forms are designed to support user-entered data.

    The process up to and including the creation of the form DOM is identical for all forms. However, non-interactive forms have a set of data to merge with their form design. In the case of forms that have a fixed layout, data merging does not determine the presentation rules for the form; that is, data is merged into the appropriate fields without changing the field properties. In contrast, when data is merged with forms that have a flowable layout, the fields grow or shrink to accommodate the amount of data merged into them.

    The Form DOM for forms with both fixed and flowable layouts looks very similar; it is one long form with no pagination. When the data and presentation rules are applied to these types of forms, they must be formatted according to the layout information. A Layout DOM is created from the Form DOM that structures the form into pages and applies any other page-based rules, such as page numbering, headers, and trailers. The following diagram illustrates this process.

    After the layout rules are applied to forms that have a fixed or flowable layout, both types of forms are complete.

XML Form Object Model DOMs

connectionSet Model

The connectionSet model controls a data schema as well as a data source used by a particular form. This model describes connections to XML schema, sample XML data, or web services. Using the connectionSet model, it is possible to extract the details, such as a URL, for a referenced schema or WSDL for reporting purposes.

The connectionSet model consists of the following objects:

Data Model

The Data model is the in-memory representation of user data. When a form design and data are merged using the data-binding process, the data model supplies the content for fields on the final form.

Using this model, you can access and manipulate data from one of the following data sources:

Event Model

The Event model controls the changes in a form that occur before, during, and after actions take place. These actions include dynamic form events, such as the point when the data and form design are merged but before any pagination is applied, as well as interactive form events such as when a user updates the value of a field.

The Event model consists of the following object:

Host Model

The Host model provides a set of properties and methods for working at the application level. These properties and methods are available for scripting regardless of the hosting application.

The Host model consists of the following object:

Layout Model

The Layout model is the in-memory representation of a form after it is merged with data. This representation is the final layout of a form.

The Layout model consists of the following object:

Signature Model

The Signature model provides a set of methods for working with XML digital signatures that conform to the W3C XML-Signature standard (http://www.w3.org/TR/xmldsig-core/). It lets you specify script commands to sign, clear, enumerate, and verify signatures.

The Signature model consists of the following object:

sourceSet Model

The sourceSet model provides a connection between an external OLEDB database and the Data model. Using this model, you can control connections to the data source, as well as manage records within the data source.

The sourceSet model consists of the following objects:

XFA Model

The XFA model defines the application model that Designer uses to implement the XML Form Object Model. The application model is the base model from which all other models are derived.

The XFA model consists of the following objects:

packet

xfa

// Ethnio survey code removed