Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to give dynamic path to fo:external graphic xsl

Tags:

xsl-fo

The value I am getting for sp_sign(given below) I want to use it as src for fo:external graphic . I tried many things still no luck please help.

    <xsl:for-each select="//**sp_sign**">
    <xsl:value-of select="**@value**" />

//

<xsl:variable name="src" select="//sp_sign" />
<fo:external-graphic baseline-shift="super" **src="${src}"** content-height="80px" content-width="80px"/>
</fo:block> 

Thanks in advance Regards, Manik Vashisht

like image 569
Manik_Vashisht Avatar asked Jul 26 '12 08:07

Manik_Vashisht


2 Answers

I normally give the src attribute using the xsl:attribute tag

<fo:external-graphic>
      <xsl:attribute name="src">
             <xsl:value-of select="$src" />
       </xsl:attribute>
</fo:external-graphic>

the src should look like: url('path/to/image')

like image 167
santiagozky Avatar answered Nov 03 '22 01:11

santiagozky


Normally, you can add the image file like this too. Where LOGO is XML value, using apache fop 2.1

<xsl:variable name="logo" select="LOGO"/>
<fo:block>
  <fo:external-graphic src="file:///{$logo}" />
</fo:block>
like image 25
suraz Avatar answered Nov 03 '22 02:11

suraz