rsb:equals
The rsb:equals keyword compares the value of an item attribute to a reference value.
Unlike rsb:check, the rsb:equals keyword will throw an exception if the specified item does not contain the specified attribute. For the comparison to succeed, the attribute should exist and its value should match.
Note:rsb:equals and rsb:check expect the name of the attribute whose value will be compared with a given value. If you need to compare two values (for example: [feed:source |toupper ] == "RSSBUS",) use rsb:select instead.
Parameters
- item: The item parameter is used to specify the item in which to compare the attribute. Specifying an item is not required. If no item is specified, the default output item is used instead.
- attr: Name of the attribute to compare.
- case: Allows selecting between case-sensitive and case-insensitive comparison. This defaults to case-sensitive comparison, to use case-insensitive comparison set case parameter to "ignore".
- value: Reference value with which to compare the attribute.
Control Attributes:
- This keyword does not have any control attributes.
Example:
Like other conditional keywords, the body of rsb:equals may also contain an rsb:else keyword which will be executed if the values do not match.<rsb:call op="feedUnion"> <rsb:equals attr="feed:source" value="RSSBus"> <rsb:push/> </rsb:equals> </rsb:call>
See Also:
- rsb:select: To choose between more than one alternative.
- rsb:notequals: To create a block that is executed when equality is not met.