Conditional type execution
Anatomy
<is var="var" type="valid">
<elseif value1="string" value2="string|regexp" func="string">ixml</elseif>
<elseis var="var" type="type">ixml</elseis>
<else>ixml</else>
</is>
Description: The IS construct is a control flow structure that allows for conditional execution of code dependent on the data type of a variable.
If the condition is true, the embedded code is executed. Otherwise, a series of embedded ELSEIF and ELSEIS statements is tested one by one. Only the first ELSEIF or ELSEIS statement that is found to be true will be executed. If none of the conditions are true, the embedded ELSE statement will be executed instead.
Attention:
IS will propagate results into the context of its paternal statement.
Attributes
Children
elseif
Anatomy of Elsewise conditional value execution
<elseif value1="string" value2="string|regexp" func="string">ixml</elseif>
Attributes:
| Name | Type | Description |
|---|---|---|
| value1 | string | Value to compare from |
| value2 | string | regexp |
| func | string | Comparison function |
elseis
Anatomy of Elsewise conditional type execution
<elseis var="var" type="type">ixml</elseis>
Attributes:
| Name | Type | Description |
|---|---|---|
| var | var | Variable name |
| type | type | Type |
else
Anatomy of Elsewise execution
<else>ixml</else>
Examples
Example
<set var="name">iXML</set>
<is var="name" type="string">
<output>My name is a string!</output>
</is>
<!-- My name is a string! -->