The instance element is a child of the form element. It defines the structure and contents of the
forms instance data. The instance element is used to:
- initially populate the form fields. Each XPE form field may refer to a data item (or set of data items) contained within
the instance data. When the form is initially rendered, the contents of the referred fields are copied into the relevent form
field(s).
- send the form data to an action or (optionally) consistency pipeline. When any submission event is
triggered, XPE Forms will copy all the current form data into the corresponding referred instance data field. If the submission
is a normal form submission, then the contents of the instance data are validated against a nominated schema file
and if successfull, the instance data is posted to the action pipeline. If the submission triggers a
consistency submission, then no schema based validation occurs, and the form and the instance data are simply posted
to the consistency pipeline. When the execution of the consistency pipeline completes, the form is regenerated with either the fresh
instance data, or with any errors displayed.
Attributes
| Attribute name | Description |
| schema | This attribute specifies the name of the schema file to be used to validate the instance
data. This must match the name attribute of a schema defined by a xf:schema
element.
|
<xf:instance
schema="http://example.com/authentication.xsd"
xmlns:xf="http://www.xmlpipe.org/xpe/form"
>
<authentication
xmlns=""
>
<username>
fred
</username>
<password/>
</authentication>
</xf:instance>