Conditional type execution
XML
<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>
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
XML
<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
XML
<elseis var="var" type="type">ixml</elseis>
Attributes
| Name | Type | Description |
|---|---|---|
| var | var | Variable name |
| type | type | Type |
else
XML
<else>ixml</else>
Examples
XML
<set var="name">iXML</set>
<is var="name" type="string">
<output>My name is a string!</output>
</is>
<!-- My name is a string! -->