The World Wide Web started out as a way to publish physics
papers, and only later gained transactional capabilities, such as
electronic commerce. One of the key building blocks that enabled this
transition was the HTML
<FORM> tag, which made
it possible for a website to offer an empty, but structured, form to the
user and for the user to submit a completed form to the website.
XMPP includes a very similar technology for lightweight workflows called Data Forms, defined in XEP-0004. Because Data Forms are used throughout the technologies we’ll discuss in the following chapters, we introduce them now. In Chapter 11, we build on these basic concepts to explore more advanced workflows.
A data form is made up of several pieces, as shown in the following “stub” example:
<message from="email@example.com/foo" to="firstname.lastname@example.org/bar"> <x xmlns="jabber:x:data" type="form"> <title>My Special Form</title> <instructions>Please fill in the following form</instructions> <field label="Text Input" type="text-single" var="field-1"/> <field label="Make a Choice" type="boolean" var="field-2"/> <field label="For Your Eyes Only" type="text-private" var="field-3"/> <field label="Pick One" type="list-single" var="field-4"> <option label="First Option"><value>single-1</value></option> <option label="Second Option"><value>single-2</value></option> <option label="Third Option"><value>single-3</value></option> </field> <field label="Pick a Few" type="list-multi" ...