[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

<xsl:choose>

Subject: <xsl:choose>
From: Zvi Avraham <zvia@xxxxxxxxxxxxxxx>
Date: Wed, 06 Oct 1999 03:10:06 +0200
xsl change font
Hi People,

I have stock database in my XML source:

 <stocks>
  <stock symbol="PHCM" price="$142.75" change="+7.75"
volume="2,000,000"/>
  <stock symbol="ALA" price="$29.12" change="-1.25" volume="345,000"/>
  <stock symbol="ERICY" price="$31.00" change="+5.12" volume="990,000"/>

  <stock symbol="NOK" price="$87.06" change="+3.92" volume="1,234,000"/>

  <stock symbol="MOT" price="$91.00" change="-1.00" volume="1,000,000"/>

  <stock symbol="IRIQE" price="$4.25" change="0.00" volume="0"/>
 </stocks>

I want to render it in table, when earning change will be green, and
looses will be red...
I using next XSLT fragment, but seems, that no mutter whats change is,
XSLT always render
<xsl:otherwise> part ...

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.1">

[snip]

 <xsl:choose>
  <xsl:when test="number(@change) &gt; 0">
   <font face="Arial,Helvetica" size="1" color="green">
    <xsl:value-of select="@change"/>
   </font>
  </xsl:when>
  <xsl:when test="number(@change) &lt; 0">
   <font face="Arial,Helvetica" size="1" color="red">
    <xsl:value-of select="@change"/>
   </font>
  </xsl:when>
  <xsl:otherwise>
   <font face="Arial,Helvetica" size="1">
    <xsl:value-of select="@change"/>
   </font>
  </xsl:otherwise>
 </xsl:choose>

[snip]

I tried so many things, with/out number() function, using xsl:variable
etc ...

Any ideas ?

Thanks in advance
Zvi


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.