(I'm posting again to remove the spam tag, in case Mike's system will 
block the message because of it. My client's spam filter throws that in 
just often enough that I forget to check for it. My apologies to the 
list.)

Hi, Mike,

src="$logo_path" makes the XSLT processor look for a path that is 
literally $logo_path, and I bet you don't have a path like that.

Try src="{$logo_path}"

The {} indicate an attribute value template (AVT for short), which means 
that the processor will expand the value of $logo_path rather than use the 

literal string.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)





mike <[EMAIL PROTECTED]> 
Sent by: news <[EMAIL PROTECTED]>
11/23/2005 10:21 AM
Please respond to
fop-users@xmlgraphics.apache.org


To
fop-users@xmlgraphics.apache.org
cc

Subject
Spam:<fo:external-graphic limitation?






Hi all,
 I would like to load an external graphic through a parameter value?
Because it does not seem to work for me ;-(
For example, the following produces the error:
  [ERROR] Error while creating area : Error with image URL: $logo_path (No 
such
file or directory) and no base URL is specified

<?xml version="1.0"?>
<xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
     xmlns:fo="http://www.w3.org/1999/XSL/Format";>
<xsl:param name="logo_path" select="'/tmp/smartdocument.loan/logo.jpg'"/>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>

                 <fo:layout-master-set>
                                 <fo:simple-page-master 
master-name="simple"
 page-height="29.7cm" page-width="21cm"
 margin-top="1cm" margin-bottom="1cm"
 margin-left="8mm" margin-right="8mm">
                                                 <fo:region-body 
margin-top="0cm" margin-bottom="0cm"/>
                                                 <fo:region-before 
extent="5cm"/>
                                                 <fo:region-after 
extent="5cm"/>
                                 </fo:simple-page-master>
                                 <fo:page-sequence-master 
master-name="page-sequence">
 <fo:single-page-master-reference master-reference="simple"/>
                                 </fo:page-sequence-master>
                 </fo:layout-master-set>

                 <fo:page-sequence master-reference="page-sequence">
                                 <fo:flow flow-name="xsl-region-body">

                                                 <fo:block 
font-family="sans-serif" font-size="10pt"
 text-align="left">
                                                                 <fo:table 
table-layout="fixed">
  <fo:table-column column-width="95mm"/>
  <fo:table-column column-width="95mm"/>
  <fo:table-body>
                 <fo:table-row>
                                 <fo:table-cell padding="2mm">
                                                 <fo:block>
  <fo:external-graphic src="$logo_path"/>
                                                 </fo:block>
[...]

I've checked the value of logo_path and it is correct.
Maybe there's another way to do it ... Any idea?

thanx,

--mike



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to