Common Attributes

The techniques in Modularization of XHTML provide a mechanism to assemble and name common groups of attributes that can be easily referenced. The following sections describe these attribute groups.

Binding Attributes—Single Node and Node-set

A number of situations in XForms call for a reference into instance data. The term for such attributes is binding attributes, which include up to three attributes from this list:

ref

Whenever the intent of the binding attributes is to select a single node, the ref attribute will be present. It contains an XPath path expression. In cases where the selected node-set happens to have more than one node, the first node rule applies, which removes all nodes other than the first, according to the order the nodes appear in the document.

nodeset

Whenever the intent of the binding attributes is to select a node-set of any size, the nodeset attribute will be present. It contains an XPath path expression.

model

In larger or more complex documents, it will be common to have multiple XForms Models. When this is the case, an additional attribute is needed to indicate to which XForms Model the binding attaches. The value of this attribute is of type IDREF, and so a model element in the same document must have an attribute of type ID with a matching value.

bind

In some cases, such as when a graphic design professional who isn’t concerned with XPath is laying out a form, it isn’t desirable to have XPath strewn about on every set of binding ...

Get XForms Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.