jcs:first-of() Function
Syntax
var $result = jcs:first-of(object, "expression")
Description
Return the first nonempty (non-null) item in a list.
Parameters
- expression—Default value returned if all objects in the list are empty.
- object—List of objects.
Return Value
- $result—First nonempty (non-null) item in the object 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")
In the following example, the function returns the description of a logical interface. If a logical interface description does not exist, the function returns the description of the (parent) physical interface. If the parent physical interface description does not exist, the function returns the concatenation of the physical interface name with a period (.) and the logical unit number.
<xsl:variable name="description"
select="jcs:first-of(description, ../description, concat(../name, '.', name))"/>
Hide Navigation Pane
Show Navigation Pane
Download
SHA1