W3C home > Mailing lists > Public > www-xsl-fo@w3.org > May 2003

Re: dynamic external images

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Fri, 30 May 2003 15:24:24 -0400
Message-Id: <5.2.0.9.0.20030530152314.0290a728@pop.storm.ca>
To: "'www-xsl-fo@w3.org'" <www-xsl-fo@w3.org>

At 2003-05-30 14:50 -0400, Ai, Larry wrote:
>I try the following:
>
><xsl:variable name="image">
>     <!-- the following template return an image file name -->
>     <xsl:call-template name="create-image"/>
></xsl:variable>
>
><fo:external-graphic src="$image"/>
>
>FOP does not allow variable used in the attribute.

You are triggering an XSLT problem, not an XSL-FO problem.  Use an 
attribute value template to put a variable's value into a result tree 
element's attribute:

   <fo:external-graphic src="{$image}"/>

I hope this helps.

................... Ken


--
Upcoming hands-on courses: (registration still open!)
-      (XSLT/XPath and/or XSL-FO) North America: June 16-20, 2003

G. Ken Holman                mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.         http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                      Definitive XSLT and XPath
ISBN 0-13-140374-5                              Definitive XSL-FO
ISBN 1-894049-08-X  Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X              Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:    http://XMLGuild.info
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
Received on Friday, 30 May 2003 15:24:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:10 GMT