The constraint Property

Release 2.0 - ...

Specifies a predicate that needs to be satisfied for the associated instance data node to be considered valid.

Computed Expression Yes
Legal Values Any expression that is convertible to XPath boolean with boolean().
Default Value true()
Inheritance Rules does not inherit.

When evaluating to XPath false, the associated model item is not valid; the converse is not necessarily true. This model item property does not prevent form controls and XForms actions from setting invalid values into data nodes.

Example

XML CopyCode image Copy Code
<xforms:bind nodeset="/range/to" constraint="number(.) &gt; number(/range/from)"/>

Specification

Link to the XForms specification: the constraint Property.