xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beer, Christian" <...@DIRON.de>
Subject AW: FOP-XSL:dynamic external graphics
Date Mon, 07 Jan 2002 07:21:29 GMT
Hello!!

Well, try this one: 
<fo:external-graphic src="{$filepathValue}" />

"{" and "}" are kind of escape-chars, that tell xalan to process their
content.

You can also do this, I think, if you only need the filename one time.
<fo:external-graphic
src="{concat('file:../default/tra-app/images/',client/id,'logo.gif')}" />


Greetz

Christian

-----Urspr√ľngliche Nachricht-----
Von: Rachael Blank [mailto:blankrr@mars-systems.com]
Gesendet: Freitag, 4. Januar 2002 18:46
An: fop-dev@xml.apache.org
Betreff: FOP-XSL:dynamic external graphics


Hello and thanks in advance for your help!

Is there a way I can dynamically display images based on an xml tag that
I am given?

I receive the following xml:
<client>
   <id></id>
   ...
</client>

I currently have the following uri specification and it works:
<fo:external-graphic src="file:../default/tra-app/images/chclogo.gif"/>

I need the image name (chclogo.gif) to change depending on the
<client><id>a number</id></client> that I receive in the xml.

I thought something like this would work:
<fo:table-cell>
   <fo:block
       white-space-collapse="true">
       <xsl:variable name="filepathValue" 
           
select="concat('file:../default/tra-app/images/',client/id,'logo.gif')"
/>     
       <fo:external-graphic src="$filepathValue" />
       <xsl:value-of select="$filepathValue" /><!--Error checking-->
   </fo:block>
</fo:table-cell>

I am receiving the following error with the above code:
Error while creating area : Invalid Image URL - error on relative URL :
java.lang.NullPointerException

I am sure that I have the correct path (because the $filepathValue
displays correctly on the screen via my value-of select statement), but
I am thinking it is not possible to pass a variable into the src element
of the fo:external-graphic statement.  I also made sure this image is
correctly named and in the appropriate directory.

Any thoughts or alternatives, anyone?

Thanks!

Rachael










Can I

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Mime
View raw message