You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Sampige, Srinivas" <sr...@boeing.com> on 2002/02/19 02:34:57 UTC

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