W3C

XForms 1.1

3.3.4 The bind Element

Element bind selects a node-set from the instance data with a model binding expression in the nodeset attribute. Other attributes on element bind encode model item properties to be applied to each node in the node-set. When bind has an attribute of type xsd:ID, the bind then associates that identifier with the selected node-set.

Common Attributes: Common, Model Item Properties (Optional)

Special Attributes:

nodeset

An optional attribute containing a model binding expression that selects the set of nodes on which this bind operates.

context

Optional attribute containing an XPath expression evaluated using the in-scope evaluation context. The result of the XPath expression is used to override the in-scope evaluation context. By adjusting the in-scope evaluation context, this attribute affects the evaluation of subsequent attributes that may appear on bind, including nodeset and Model Item Properties.

Editorial note: NickVdB2008-02-01
If the context attribute is used on insert and delete, only the first node of the nodeset returned by the XPath expression is used as the new in-scope evaluation context. But I think we don't want to limit the new in-scope evaluation context by specifying context on a bind to be limited to the first node.

See 6 Model Item Properties for details on model item properties.

See 7.2 Evaluation Context for details on how the evaluation context is determined for each attribute of the bind element.

Simplifying XPath expression by using context

Without using context

<bind nodeset="c" caclulate="../a + ../b" />

Using context

<bind nodeset="c">
    <bind context=".." caclulate="a + b" />
</bind>
=