Overview of XForms model syntaxAdded by IBM on October 10, 2012 | Version 1 (Original)
The 'xformsmodels' option is an important form global option that contains one or more <xforms:model> elements. It is recommended that a form contain only one XForms model, however, multiple models are allowed (though they have no ability to interact).
An XForms model has a number of possible components, but the principal components that it defines are as follows:
The XFDL items that define GUI widgets include within their content XForms controls that allow the GUI widgets (as well as invisible 'custom' items) to connect to instance data in the XForms models. Modifications of the XFDL items cause data to be pushed through the user interface bindings of the XForms controls and into the instance data. The formulae definitions in the XForms model are then executed automatically, resulting in changes to calculated values as well as updates to validity constraints and other model item properties. All of the changes to values, validity and properties that were made by an XForms model are then percolated back out to the user interface layer by modifications to the GUI widgets and other XFDL items.
The full validity of a node of instance data is assessed by combining under Boolean-And the conformance of its content to any XML schema declarations for the node, to the schema type given by the type MIP, and to the formula given by its constraint MIP (if any of these are defined).
An instance node with a non-relevant or readonly ancestor is non-relevant or readonly regardless of any state directly declared for the node. While non-relevance and readonly status are inherited, the converse is not true. If every ancestor of a node is relevant or not readonly, then the node's relevance and readonly status are determined by the direct settings for the node (if any, or defaults otherwise).
- One or more instances of XML data over which the form operates. Instances usually appear directly within the form, but they may also be externally referenced
- Optional XML schema definitions for the data instances. If XML schema are used, they are often externally referenced, but they may be placed directly within an XForms model.
- Model Item Property (MIP) Definitions:
- calculate – Defines an XPath formula with a string result that gives the content (value) of a node of instance data.
- constraint – Defines an XPath formula with a Boolean result that helps determine the validity of a node of instance data.
- readonly – Defines an XPath formula with a Boolean result that helps determine whether a node is modifiable.
- relevant – Defines an XPath formula with a Boolean result that helps determine whether a node is relevant to processing. By default, the GUI widgets bound to non-relevant nodes are invisible and inactive (unless overridden by the appropriate XFDL options), and they are not submitted.
- type – Defines a static string (not a dynamic XPath formula) that gives a basic schema data type for a node of instance data (these can be assigned without using an XML schema definition).
- Parameters for submission of data to a server (e.g. an http or https URL, a method of get or post, and an indication of whether the result should replace a data instance or replace the entire form). The XForms submission process removes non-relevant instance data nodes.