The case element child of the toggle element

Release 2.0 - ...

The case element child of the toggle action element provides an alternate means of specifying the identity of a case element to select with a switch.

The case to be selected by the toggle action is given by the case attribute or the case element. If both are given, the element takes precedence.
Due to the addition of the element, the case attribute is no longer required, but either the case attribute or the case element must appear.

The case element can provide the identity of a case with either its string content or the value attribute. If both are given, then the value attribute takes precedence.

Example

XML CopyCode image Copy Code
<xforms:toggle ev:event="DOMActivate">
   <xforms:case>out</xforms:case>
</xforms:toggle>

Attributes

Name Required / optional Description
value optional Attribute containing an XPath expression to evaluate using the in-scope evaluation context.
To obtain the case identity, the result of the expression is processed as if by call to the XPath string() function.
An empty string is used if the XPath evaluation fails

Content

The case element only allows inline text content.

Specification

Link to the XForms specification: the case element child of the toggle element.