rsb:case
The rsb:case keyword is used with rsb:select keyword. The rsb:case keyword consists of a block of RSBScript that is executed if the value in rsb:select matches the value in rsb:case.
Parameters:
- value: The pattern or value to compare against the value specified in rsb:select.
- match: Specifies how matching is done to determine whether the case statement should be executed. The default value is "exact", which requires an exact match of the value. Other supported types are "regex", for regular expression matching, and "glob", which supports a simple expression model similar to the one used in filename patterns (e.g. *.txt).
Control Attributes:
- This keyword does not have any control attributes.
In this example, a select is done based on the feed:source output element of the feedUnion operation. The rsb:case elements look for "rssbus" or "nsoftware" in the feed:source, and, if they find any occurrences, take the action associated with that case.<rsb:select value="[feed:source]"> <rsb:case match="regex" value="rssbus"> <img src="http://www.rssbus.com/favicon.ico" /> </rsb:case> <rsb:case match="regex" value="nsoftware"> <img src="http://www.nsoftware.com/favicon.ico" /> </rsb:case> <rsb:default /> </rsb:select>
See Also:
- rsb:select : To learn how you can write a multi-select RSBScript block.
- rsb:default : To learn how to write a default case for rsb:select.