The model element

Release 2.0 - ...

This element represents a form definition and is used as a container for elements that define the XForms Model. No restriction is placed on how many model elements may exist within a containing document.

Example

XML CopyCode image Copy Code
<xf:model>
   <xf:instance xmlns="">
      <root>
         <data />
      </root>
   </xf:instance>
   <xf:submission id="send" method="post" 
     action="http://xformstest.org/cgi-bin/echo.sh" ref="." 
     serialization="multipart/form-data" />
</xf:model>

Attributes

Name Required / optional Description
functions optional Space-separated list of XPath extension functions (represented by QNames) required by this XForms Model.
schema optional List of xsd:anyURI links to XML Schema documents outside this model element.
version optional Attribute with a default value of empty string and legal values defined by the datatype xforms:versionList.
Examples are "1.0" and "1.0 1.1".
Common Attributes optional Any attribute from the Common Attributes collection (e.g. id).

Content

Within an model element, the following child elements are allowed:

Element Name Required / optional Description
instance optional This element contains or references initial instance data.
xs:schema optional Inline schema definition.
submission optional The submission element represents declarative instructions on what to submit, and how.
bind optional This element selects a node-set from the instance data and encodes model item properties to be applied on this node-set.
Action element(s) optional Any element from the Action Elements Collection.
extension optional This element is a container for application-specific extension elements from any namespace other than the XForms namespace.

Each of these elements are allowed zero, one or multiple times in any order.

Specification

Link to the XForms specification: the model element.