Also, I suspect the variable element should read:

<xsl:variable name="bakColor" select="'yellow'"/>

rather than

<xsl:variable name="bakColor" select="yellow"/>

The first element sets the bakColor variable to the string 'yellow', the second sets it to the child element named 'yellow' if it exists.

-Jim

Savino, Matt C wrote:

If you need to use a variable instead of an attribute, try this (don't
forget the '$'):

  <fo:table background-color="{$bakColor}" />


<snip>

-----Original Message-----
From: Sampige, Srinivas [mailto:[EMAIL PROTECTED]
Sent: Monday, February 18, 2002 5:41 PM
To: '[EMAIL PROTECTED]'
Subject: RE: setting a property with value of a variable


Okay ,found the answer <fo:table background-color="@bakColor">

-Srinivas

-----Original Message-----
From: Sampige, Srinivas [mailto:[EMAIL PROTECTED]
Sent: Monday, February 18, 2002 5:35 PM
To: FOPuser (E-mail)
Subject: setting a property with value of a variable


Hi
I want a set of tables with alternating background colours. To do this I
intend to set the background of the table with the value of a variable which
will contain "white" or "grey". How do I do that?. Presently my .XSL
contains this -


 <xsl:template match="record">

        <xsl:variable name="bakColor" select="yellow"/>
        <fo:table background-color='<xsl:value-of select="bakColor"/>\'>
                <fo:table-column column-width="20mm"/




Reply via email to