I use fop 2.1 and I need to load an external graphic with an absolute path. I tried this:
<fo:root xsl:use-attribute-sets="text-attributes">
<fo:layout-master-set>
...
<fo:page-sequence master-reference="master">
<xsl:call-template name="pageHeader"/>
<xsl:call-template name="pageFooter"/>
<fo:flow flow-name="xsl-region-body">
...
</fo:flow>
</fo:page-sequence>
...
<xsl:template name="pageHeader">
<fo:static-content flow-name="region-before-first">
<fo:block>
<fo:external-graphic src="url({concat('file:/',$logo-image)})" height="15mm" content-height="15mm"/>
</fo:block>
</fo:static-content>
</xsl:template>
$logo-image contains the absolute path like C:/users/.../application/logo.gif
I get the following error:
PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Invalid property value encountered in src="url(file:/C:/users/.../application/logo.gif)" .... Invalid URI specified
Any idea?
I tried also to put ' around like "url('file:/C:/users/.../application/logo.gif')" and else at divers place. No success... :-(
As in some other stylesheets I do have external graphic that functions I tried also take the header into the normal flow ( => not static ). Not really the way to do for a header, but a try... :
<fo:root xsl:use-attribute-sets="text-attributes">
<fo:layout-master-set>
...
<fo:page-sequence master-reference="master">
<!--<xsl:call-template name="pageHeader"/>-->
<xsl:call-template name="pageFooter"/>
<fo:flow flow-name="xsl-region-body">
<xsl:call-template name="pageHeader"/>
...
</fo:flow>
</fo:page-sequence>
...
<xsl:template name="pageHeader">
<fo:block-container position="absolute" top="10mm" left="10mm">
<fo:block>
<fo:external-graphic src="url({concat('file:/',$logo-image)})" height="15mm" content-height="15mm"/>
</fo:block>
</fo:block-container>
</xsl:template>
But: Independantly if I put
<fo:external-graphic src="url({concat('file:/',$logo-image)})" height="15mm" content-height="15mm"/>
or
<fo:external-graphic src="url({concat('file:///',$logo-image)})" height="15mm" content-height="15mm"/>
I get same stupid error:
.... Invalid URI specified