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"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/>
                <fo:table-column column-width="20mm"/> 

                <fo:table-body>
                        <xsl:apply-templates/>
                </fo:table-body>
        </fo:table>
  </xsl:template>

 But I am getting this error when I try to apply it to my XML file -
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-----------------
C:\Apps\Apache Group\xalan-j_1_2_2\samples\SimpleTransform>java
SimpleTransform
file:///C:/Apps/Apache
Group/xalan-j_1_2_2/samples/SimpleTransform/jeffReport.xsl; Line 71; Column
 31
XSL Error: Could not parse jeffReport.xsl document!
XSL Error: SAX Exception
Exception in thread "main" org.apache.xalan.xslt.XSLProcessorException: The
value of attribute "ba
ckground-color" must not contain the '<' character.
        at
org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1753)
        at
org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(XSLTEngineImpl.java:8
13)
        at
org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:647)
        at SimpleTransform.main(SimpleTransform.java:81) 
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-------------

can sombody please help?

thanks
Srinivas

Reply via email to