Dynamic URL for background-image

Here should go questions about transforming XML with XSLT and FOP.
sanjeev.gour
Posts: 4
Joined: Thu Oct 25, 2007 1:57 pm

Dynamic URL for background-image

Post 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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
Post Reply