The method element

Release 2.0 - ...

The method element allows the submission method to be dynamically calculated based on instance data.

The method to be used by the submission can be specified with either the value attribute or the string content of the method element. If both are specified, then the value attribute takes precedence.

If the submission does not have a method child element, then the submission method is obtained from the method attribute.

Example

XML CopyCode image Copy Code
<xforms:model>
   <xforms:instance>
      <data>
         <mthd>post</mthd>
      </data>
   </xforms:instance>
   <xforms:submission id="submit" action="http://xformstest.org/cgi-bin/echo.sh">
      <xforms:method  value="mthd" />
   </xforms:submission>      
</xforms:model>

Attributes

Name Required / optional Description
value optional Attribute containing an XPath expression to evaluate using the in-scope evaluation context.
To obtain the method, the result of the expression is processed as if by call to the XPath string() function.
An empty string is used if the XPath evaluation fails

Content

The method element only allows inline text content.

Specification

Link to the XForms specification: the method element.