This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: comparing the valie of an attribute..
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] comparing the valie of an attribute..
- From: sara dot mitchell at ps dot ge dot com
- Date: Tue, 9 Jan 2001 15:58:21 -0500
- Reply-To: xsl-list at lists dot mulberrytech dot com
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@jenitennison.com]
> Sent: Tuesday, January 09, 2001 1:26 AM
> To: xsl-list@lists.mulberrytech.com
> Subject: Re: [xsl] 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