ShoX reference documentation. Index


XSL element choose

Default keyword for choose is switch.

ShoX syntax:

switch [other attributes] {case+ default?}

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:choose.