XSL-FO Question
Bit off the wall this one, I'm trying to insert a graphic into an FO document, however, the graphic used is dependant on a value in the source XML, this is my code...
<xsl:variable name="imgsrc" select="concat('/fop-0.20.5/images/', /ehub_document/ehub_from, '.jpg')"/>
<fo:external-graphic src="$imgsrc"/>
When using the Apache FOP tool to convert the FO doc to PDF it is seeing $imgsrc as a literal, i.e. it is looking for a file called $imgsrc! If I omit the quotes from the src attribute, it then complains that quotes are expected.
Up until now I've just done this with a big <xsl:when>, but the number of options is now approaching 10 and it's getting a bit ugly! E.g.
<xsl:choose>
<xsl:when test="/ehub_document/ehub_from = 'foo'">
<fo:external-graphic src="foo.jpg"/>
</xsl:when>
</xsl:choose>
Anyone know if this is possible? Bit of a long shot I know :)
Gray
|