|
|
|
||||||
Description |
|
||||||
|
The <default_> tag is component of the <switch_> statement. If the exact match of the content of the <case_> tag is not found, the code inside <default_> tag will be executed. |
|
||||||
Example |
|
||||||
|
<?xml version="1.0" encoding="utf-8"?> . . . <switch_ input="this.address.zipcode"> <case_ value="31-526"> <text>Kraków (Kraków-Śródmieście)</text> </case_> <case_ value="45-573"> <text>Wrocław</text> </case_> <default_> <text>I dont know this code</text> </default_> </switch_> . . . |
|
||||||
|
|
|
||||||
|
The code should be interpreted as follows: check the value of the expression this.address.zipcode, if the result is 59-220, then execute the instruction <text>Legnica</text> and abort execution of the switch block. If 45-573 is the result, then execute the instruction <text>Wrocław</text> and abort the switch block. If none of these cases apply, execute the <text>I don't know this code 😊</text> instruction and end the switch block. The default block is optional and can be omitted. |
|
||||||
Visual output |
|
||||||
|
|
|
||||||
Attributes |
|
||||||
|
|
|
||||||
|
|
||||||
Child elements permitted |
|
||||||
|
All the elements that are permitted as child elements of the <content> tag are allowed to be child elements of the <default_> tag. |
|
||||||
Parent elements permitted |
|
||||||
|
<switch> |
|
||||||
|
|
|
||||||
|
|
|
