This function returns the first nonempty (non-null) item in a list. In the following example, if the value of a is empty, b is checked. If the value of b is empty, c is checked. If the value of c is empty, d is checked. If the value of d is empty, the string none is returned.
- jcs:first-of($a, $b, $c, $d, "none")
The following example selects the description of a logical interface if there is a logical interface description. If not, it selects the description of the (parent) physical interface if there is a physical interface description. If not, it selects the concatenation of the physical interface name with a “ .” and the logical unit number.
<xsl:variable name="description"
select="jcs:first-of(description, ../description, concat(../name, '.', name))"/>