The submission element
Release 2.0 - ...
The submission element represents declarative instructions on what to submit, and how.
Example
XML | Copy Code |
---|---|
<xforms:submission id="submitMakeModel" ref="/car/make" resource="http://xformstest.org/cgi-bin/echo.sh" method="post"/> |
Attributes
Name | Required / optional | Description |
---|---|---|
ref | optional | Selector binding expression enabling submission of a portion of the instance data. The selected node, and all descendants, are selected for submission. The default value is "/". |
bind | optional | Reference to a bind element. When present, the binding reference on this attribute is used in preference to any binding reference from the ref attribute. |
resource | optional | Attribute indicating the destination URI for submitting instance data. This attribute is not author-optional unless the destination URI is provided by the resource element, which can dynamically specify the URI based on instance data, or the action attribute. This attribute should be used in place of the action attribute. |
action | optional | Deprecated author-optional attribute indicating the destination URI for submitting instance data. |
mode | optional | Attribute defaulting to asynchronous and with legal values of synchronous and asynchronous. |
method | optional | Specifies the protocol operation to be used to transmit the serialized instance data. There is no default value because either the attribute method or the element method must be specified. Legal values: post, put, get, delete, multipart-post, form-data-post, urlencoded-post, any other NCName, QNameButNotNCName |
validate | optional | Boolean attribute that indicates whether or not the data validation checks of the submission are performed. The default value is false if the value of serialization is none and true otherwise. |
relevant | optional | Boolean attribute that indicates whether or not the relevance pruning of the submission is performed. The default value is false if the value of serialization is none and true otherwise. |
serialization | optional | Attribute that controls how and whether to serialize instance data as part of the submission. The default value of this attribute is based on the submission method. Supported values: application/xml, application/x-www-form-urlencoded, multipart/related, multipart/form-data, none |
version | optional | Specifies the version of XML to be serialized. The default is "1.0". |
indent | optional | Boolean attribute specifying whether the serializer should add extra white space nodes for readability. The default is false. |
mediatype | optional | Specifies the mediatype for XML serialization of instance data. Authors should ensure that the type specified is compatible with the data being submitted, such as application/xml for posted XML data. The default is application/xml. |
encoding | optional | Specifies an encoding for serialization. The default is UTF-8. |
omit-xml-declaration | optional | Boolean attribute specifying whether to omit the XML declaration on the serialized instance data. The default value is false. |
standalone | optional | Boolean attribute specifying whether to include a standalone declaration in the serialized XML. If the omit-xml-declaration attribute has the value true, then this attribute is ignored. Otherwise, if this attribute is omitted, then the XML declaration does not include a standalone document declaration, and if this attribute is specified, then the XML declaration includes a standalone document declaration with the same value as this attribute. |
cdata-section-elements | optional | Specifies element names to be serialized with CDATA sections. The default is empty string. |
replace | optional | Specifies how the information returned after submit should be applied. In the absence of this attribute, all is assumed. The legal values are all, instance, text and none. |
instance | optional | Specifies the instance to replace when the replace attribute value is instance. When the attribute is absent, then the default is the instance that contains the submission data. |
targetref | optional | Contains an XPath expression that indicates the target node for data replacement. |
separator | optional | Specifies the separator character used between name/value pairs in urlencoding. The default value is '&'. To express the default, character entity encoding is used: separator='&amp;'. |
includenamespaceprefixes | optional | Provides control over namespace serialization. If absent, all namespace nodes present in the instance data are considered for serialization. If present, specifies list of namespace prefixes to consider for serialization, in addition to those visibly utilized. The special value "#default" specifies the default namespace. |
Common Attributes | optional | Any attribute from the Common Attributes collection (e.g. id). |
Content
Within an submission element, the following child elements are allowed:
Element Name | Required / optional | Description |
---|---|---|
resource | optional | The resource element allows the URI used for a submission to be dynamically calculated based on instance data. |
method | optional | The method element allows the submission method to be dynamically calculated based on instance data. |
header | optional | The header element can be used to contribute information to the preamble of a submission in a manner appropriate to the protocol. |
Action element(s) | optional | Any element from the Action Elements Collection. |
Specification
Link to the XForms specification: the submission element.