DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Using Choose, When And Otherwise To Replace - And +

  • submit to reddit
        This uses choose, when and otherwise to replace - and + when $day_change would return '+0.1p'. The result would be 'Up 0.1p'

 <xsl:when test="$day_change > 0">
    Up <xsl:value-of select="$day_change" />
 <xsl:when test="$day_change < 0">
    Down <xsl:value-of select="$day_change" />
    No change