XSLT xsl:otherwise Element
Complete XSLT Element Reference Manual
Definition and Usage
xsl:otherwise The element specifies xsl:choose the default action of the element. When no xsl:when conditions apply, this action occurs.
Syntax
property
None
Example 1
The code below adds a pink background color to the artist column when the price of a cd is greater than 10; otherwise it simply outputs the artist's name:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">My CD Collection
Title
Artist
View the XML file、 View the XSL file、 View the result。
Example 2
Declares a variable named "color". Its value is assigned to the color attribute of the current element. If the current element has no color attribute, the value of "color" will be "green":
xsl:otherwisegreen
Complete XSLT Element Reference Manual