ShoX reference documentation. Index


XSL element when

Default keyword for when is case.

ShoX syntax:

case [other attributes] (@test) {template}

Example

        switch {
            case(count(rabbit)>10) {
                call rabbitcatcher{}
            }
            case(count(rabbit)>1) {
                apply(rabbit)
            }
        }

        // use as if-then-else:
        switch {
            case(count(rabbit)>10) {
                call rabbitcatcher{}
            }
            default {
                apply(rabbit)
            }
        }
	

See also when otherwise if.

XSL documentation of element xsl:when.