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

RE: comparing the valie of an attribute..

Subject: RE: comparing the valie of an attribute..
From: sara.mitchell@xxxxxxxxx
Date: Tue, 9 Jan 2001 15:58:21 -0500
xsl comparing variables and attributes
True...I just got finished setting up variables to handle
changes to colors and it must have been 'on my mind' too much.
Thanks for the catch, 

Sara

> -----Original Message-----
> From: Jeni Tennison [mailto:mail@xxxxxxxxxxxxxxxx]
> Sent: Tuesday, January 09, 2001 1:26 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  comparing the valie of an attribute..
> 
> 
> Sara Mitchell wrote:
> > To use xsl:choose, you can do something like this:
> >
> > <xsl:template match="event">
> > <!-- set variable based on the value of type attribute -->
> > <xsl:variable name="colortype">
> > <xsl:choose>
> > <xsl:when test="@type='error'">#990000</xsl:when>
> > <xsl:otherwise>#dddddd</xsl:otherwise>
> > </xsl:choose>
> > </xsl:variable>
> > <td>
> > <!-- assign background color using variable -->
> > <xsl:attribute name="bgcolor"><xsl:value-of select="$colortype"/>
> > </xsl:attribute> 
> >  ...what ever your cell content should be here...
> > </td>
> > </xsl:template>
> 
> There's no particular need to use a variable here unless you reuse the
> colour elsewhere. [snipped]

 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.