http://onion.net/genericforms

chooseString ([condition : boolean], trueValue : string, falseValue : string) : string

The method chooseString() performs a check of the condition and returns values according to the result. If there is no condition, then it is checked whether trueValue supplies a result, otherwise falseValue is returned.

The following example shows how character strings can be checked.

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

In the case of the first chooseString(), the value of the variable $value is displayed as a result, since the length of the character string is greater than zero.

The result of the second chooseString() also outputs the value of the variable $value, since the first variable supplies no result or supplies an empty result.