Search code examples
xmlxsltxslt-1.0xsl-fo

Why isn't my image displayed in XSL-FO?


In one of my project, I have to add image in a pdf with xslt and xml. However, my images isn't displaying at all.

Here's my xslt snippet

<fo:block text-align="left">
<fo:external-graphic src="url({$var})" content-height="6pt" content-width="6pt"/>
</fo:block>

(I've tried with and without the url part, but since it was already there I decided to show it in my question)

The variable var is declared in another files that is included.

<xsl:variable name="imgPath"></xsl:variable>
<xsl:variable name="var">
<xsl:value-of select="$imgPath"/>image.svg</xsl:variable>

The problem, I have is that even though I can see the right path of the image when I debug, the image is not displayed in the final result.

I don't think it is a problem with the location of the image since both the xsl and the images are at the same level (So image.svg is the correct path to access the image)


Solution

  • So, the answer to my problem is that there were an accent in the name of my file which made my FOP unable to locate my files. Some time the most simple problems are the hardest to find.