|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem setting variable in if statement
At 2004-02-02 12:02 -0700, Johnson, Kaerstin wrote:
I am very new to xsl/xslt and have a basic problem. I am setting a style sheet color based on a condition. I'd like the color to be a variable value, like <xsl:variable name="statColor" select="#33cc33"> and set this variable in the if/choose condtion. In XSLT you have to turn this inside out: <xsl:variable name="statColor">
<xsl:choose>
<xsl:when test="status='inprogress'">#33cc33</xsl:when>
<xsl:when>...
</xsl:choose>
</xsl:variable>Then it is in scope for all following siblings and their descendants, and you can go ahead and use it as desired: I hope this helps. ........................ Ken
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








