The bind element

Release 2.0 - ...

Element bind selects a node-set from the instance data with either a model binding expression in the nodeset attribute or the default of the in-scope evaluation context node.

Other attributes on element bind encode model item properties to be applied to each node in the node-set. When bind has an id attribute of type xsd:ID, the bind then associates that identifier with the selected node-set.

Example

XML CopyCode image Copy Code
<xf:bind nodeset="node()[@required='true']" required="true()"  />
<xf:bind nodeset="a:State" relevant="//a:Country = 'USA'" />
<xf:bind nodeset="a:City" calculate="if(substring(//a:Zip, 1, 2)='26', 'Delft', '')" />
<xf:bind nodeset="a:City" readonly="false()" />

Attributes

Name Required / optional Description
nodeset optional Contains a model binding expression that selects the set of nodes on which this bind operates.
If the attribute is omitted, the default is the in-scope evaluation context node.
Common Attributes optional Any attribute from the Common Attributes collection (e.g. id).
Model Item Properties optional Any model item property (calculate, type, required, constraint, relevant, readonly, p3ptype).

Content

Within an bind element, the following child elements are allowed:

Element Name Required / optional Description
bind optional Bind elements can be nested.

Specification

Link to the XForms specification: the bind element.