Review: Submission Options

As a general rule, the URI scheme and serialization method can be chosen as follows.

Your first instinct should be to use GET with application/x-www-form-urlencoded, unless your solution meets one of the good reasons not to use GET, mentioned earlier in the “When to Use Get” sidebar. For everything else, consider first using POST with application/xml, unless you need to be compatible with a “legacy” server that’s expecting submissions from clients running HTML forms or similar applications. Table 8-1 summarizes.

Table 8-1. Guidelines for XForms submit

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="&amp;" 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 ...

Get XForms Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.