xforms:instanceAdded by IBM on August 8, 2013 | Version 1 (Original)
|Contains the XML data of the XForms model. The data must be valid XML with a single root, allowing the use of existing data models from other applications.
Table 1. xforms:instance parameters
<xforms:instance id="name xmlns="namespace
|name||string||Optional. An arbitrary name that you may assign to each model and data instance. The first model/instance is default, and does not require an ID. All subsequent models and instances do.
All names assigned to id attributes must be globally unique within the form.
|namespace||string||Optional. The namespace of the instance data. All references to instance data must include an appropriate namespace prefix, unless you use the empty namespace (denoted by empty quotation marks, "").|
|source||URI||Optional. Use the src attribute to point to an external file that contains the instance data.
This supports HTTP, HTTPS, and file URIs. Relative URIs are evaluated based on the location from which the form was obtained.
When the document is retrieved from the Web, relative file locations are evaluated from the following folder:
Documents and Settings -> user -> Application Data -> PureEdge\xforms
|resource||URI||Optional. Similar to the src attribute except for precedence. Both the src attribute and inline instance data have precedence over the resource attribute. |
|instance_data||XML||Optional. An arbitrary XML data instance with a single root. This can be as simple or complex as you like, as long as it is valid XML.
If the containing <xforms:instance> tag has an src attribute, this instance data is ignored and the loaded data is used instead.
This example shows a small XForms data model with an xforms:instance that has the name, age, and birth date of a person.
<xforms:bind nodeset="age" type="xsd:integer"/>
<xforms:bind nodeset="birthdate" type="xsd:date"/>
<xforms:submission id="submitTest" method="post"
- If an element in the XForms data instance is both empty and invalid, then any item on the form that is bound to that element is set to be mandatory.