Differences between XForms 1.0 and 1.1
This list reflects the differences between the Rec version of XForms
1.0 and the last call version of
XForms 1.1, and only feature a high-level view of the differences.
Many of the changes only effect minor details about the processing model
(such as clarifications).
Most of the changes are additions and simplifications, though control of
submission has greatly improved.
Model and instance
New version attribute: <model version="1.1">...
New resource attribute: <instance resource="...">
New Datatypes
- xforms:email
- xforms:ID-card-number
For credit cards and other ID cards
- Also-Empty datatypes
The existing datatypes like xsd:integer all had to be non-empty. This
meant empty fields were always invalid, even if they weren't required.
The new datatypes may all also be empty to get over this problem.
<bind nodeset="q" required="true()" type="xsd:integer"/>
is now
<bind nodeset="q" required="true()" type="xforms:integer"/>
Submission
The first submission element is now the default, so if you only have one
submission a submit control doesn't need to specify it.
Submission: attributes
To control submission more, the <submission>
element
now has a number of new attributes and child elements.
Attributes:
- resource: same as
action
(see element)
- mode (asynch, synch): asyncronous or synchronous submission.
Asynchronous is default.
- method="delete": supports http DELETE method.
- verb: overrides the method attribute
- serialize: whether data is to be sent with the submission
- validate: whether to validate the data (for instance for save to
file)
- relevant: whether to prune non-relevant data
- replace="text": accept text results, and replacing parts of
instance
- target: used with replace="text"
Submission: elements
- resource
Allows you to get submission URI from an instance. Overrides the
action
attribute.
- verb
Likewise allows you to specify the method in an instance.
- header
Allows you to add headers to the submission
Submission for Soap
Better support for soap submission
Events
New events:
- xforms-submit-serialize
- xforms-version-exception
- xforms-output-error
New Functions
- number power(number, number): xy
- boolean luhn(string?): checks credit card number is valid
- number random(boolean?): generates a random number between 0 and 1.
- string days-to-date(number)
- string seconds-to-dateTime(number)
- string local-date()
- string local-dateTime()
Encoding and decoding functions
- string encode(string, string?): encode string as base64 (default) or
hex
- string decode(string, string?): decodes
- string digest(string, string, string?): for passwords etc.
md5, sha1, sha256, sha384, sha512
- string hmac(string, string, string, string?): for passwords etc.
Control functions
- node-set current(): resets the context in an XPath expression
- object choose(boolean, object, object): a version of if() but then
returning objects, not strings
- node-set id(object, node-set?): the elements in an instance with chosen
ids.
- object event(string): The details of an event.
- string property(string): "version" (=1.1) and "conformance-level" =
(full, basic, etc)
Controls
- Output mediatype: for outputting more than text.
- <submit>, <trigger>+appearance
- case+action child
- toggle+case child
- repeat+switch child
Actions: insert and delete
insert action improved
delete action improved
Conditional and repeated actions
<delete if="XPath Expression" .../>
<delete while="XPath Expression" .../>
On all actions
New attribute on dispatch action
<dispatch delay="1000" ... /> allows polling.
Additions to actions
dispatch+name child element
dispatch+target child element
dispatch+delay child element
setfocus+control child element
load+resource child