Page 1 of 1

Dynamic URL for background-image

Posted: Wed Nov 14, 2007 11:51 am
by sanjeev.gour
Hi,
When I use the following code, the image gets displayed correctly in the PDF-

Code: Select all

<fo:block border-style="solid" border-width="0.2pt"
text-align="left" font-size="8pt"
font-weight="bold" color="white" padding-top="1pt"
padding-bottom="1pt"
background-image="url{'http://localhost:8080/project/images/table_header_center.png'}">
<xsl:value-of select="tr/td/span" />
</fo:block>
but when I assgn the path to a variable like the following-

Code: Select all


	<xsl:variable name="imgPath"
select=" 'http://localhost:8080/project/images/table_header_center.png' " />
and then use-

Code: Select all

<fo:block border-style="solid" border-width="0.2pt"
text-align="left" font-size="8pt"
font-weight="bold" color="white" padding-top="1pt"
padding-bottom="1pt"
background-image="url{$imgPath}">
<xsl:value-of select="tr/td/span" />
</fo:block>
I dont get the image on the PDF. Am I missing something??

Thnxxx.
Sanjeev.

Posted: Wed Nov 14, 2007 5:08 pm
by sorin_ristache
Hello,

Is that a fragment from an XSLT file or an XSL-FO file? If it is an XSL-FO file then you cannot use a variable. If it is an XSLT file what is the fragment of the XSL-FO result of the XSLT transformation corresponding to that fo:block element?


Regards,
Sorin