xforms:model

Purpose

Represents a form definition, used as a container for elements associated with its submission.

The xforms:model element can be placed within the head section of an XDIME 2 page, or within its body (within elements from the XHTML 2 Structural and Text modules), but it must appear before any XForms elements that refer to it.

Contains

Attribute groups

Example

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:si="http://www.volantis.com/xmlns/2006/01/xdime2/si"
  xmlns:xforms="http://www.w3.org/2002/xforms">
  <head>
    <title>Subscriber update</title>
    <xforms:model id="address">
      <xforms:instance>
        <si:instance>
          <si:item name="name"/>
          <si:item name="postcode">13004 Marseille</si:item>
          <si:item name="hidden">subscriber_id</si:item>
        </si:instance>
      </xforms:instance>
      <xforms:submission id="submit" action="http://localhost:8080/volantis/response.jsp"/>
    </xforms:model>
  </head>
  <body>
    <p>
      <xforms:input model="address" ref="name">
        <xforms:label>Name:</xforms:label>
      </xforms:input>
    </p>
    <p>
      <xforms:input model="address" ref="postcode">
        <xforms:label>Postcode:</xforms:label>
      </xforms:input>
    </p>
    <xforms:submit submission="submit">
      <xforms:label>Submit</xforms:label>
    </xforms:submit>
  </body>
</html>

Related topics