c.choose ([condition : boolean], trueValue : any, falseValue : any) : any

The function choose evaluates the given condition and returns a value based on the result. If no condition is given, the argument trueValue will be returned, if it is not empty. Otherwise the value of falseValue will be returned.

<xsl:variable name="value" select="'loremipsumdolor'" />
<xsl:variable name="empty" />
<xsl:value-of select="c.choose(string-length($value) = 0, 'Empty string', $value)" />
<xsl:value-of select="c.choose($empty, $value)" />

The first c.choose command will print the text "loremipsumdolor", as the string length of the variable value is greater than zero.

The second command also returns the text "loremipsumdolor", as the first argument does not contain any data.