This information is in part taken from the O'Reilly book XForms Essentials. Used with permission.
XForms makes it easy to arrange workflows, where data travels not just from a client to a destination server, but along various intermediate routes. This kind of processing is exceedingly commonplace in paper forms, which tend to require multiple levels of approval by different individuals.
What's more, XForms supports more than just XML data--it can also submit name/value pairs in both of the formats common to existing servers, as well as a special format designed for efficient encoding of XML containing lots of binary characters, as is typically generated by a output form control.
Submission is controlled through two main attributes on the submission element, method which takes certain predefined strings like "get", and action which takes a URL. The scheme of the url, such as http: influcences how the submission will occur.
This handy chart will help you configure the appropriate attributes on the submission element. Note that a few special-purpose attributes, such as includenamespaceprefixes and separator are used here, even though not specifically covered in this tutorial.
When you have this scenario... | ...use a submission element such as this |
|---|---|
Your solution produces a small amount of data, which contains no sensitive information and doesn't trigger any significant obligations. | <submission method="get" action="http URI"/> |
Your solution has to work with a server configured to accept GET requests from HTML forms. | <submission method="get" separator="&" action="http or https URI"/> |
Your solution creates new XML data. | <submission method="put" inlcudenamespaceprefixes="" action="http, https, ftp, or file URI"/> |
Your solution feeds XML data into a larger processing system. | <submission method="post" includenamespaceprefixes="" action="http, https, or mailto URI"/> |
Your solution has to work with a server configured to accept standard POST requests from HTML forms. | <submission method="urlencoded-post" action="http or https URI"/> |
Your solution has to work with a server configured to accept file uploads from HTML forms. | <submission method="form-data-post" action="http or https URI"/> |
Your solution produces XML data that includes lots of embedded binary data. | <submission method="form-data-post" action="http, https, or mailto URI"/> |
Your solution includes upload controls that accept anyURI data. | <submission method="multipart-post" action="http, https, or mailto URI"/> |
Since you have completed the last lesson, you can reward yourself by having no exercises, just an overall review.
Continue on for a wrap-up of this tutorial as well as information on where to go for more in-depth XForms training.
