|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl display graphic from xml
> I want to get the string returned from
> the template logo and use it for the url. Ideas?
> This is what I have.
>
> <xsl:template name="logo">
> <xsl:value-of select="invoice/images/logo"/>
> </xsl:template>
>
> <xsl:template name="getLogo">
> <fo:external-graphic src="url( D:\simple\logo.jpg)"/>
> </xsl:template>
>
So...is there a reason you need to use that template setup?
Why not just
<xsl:template name="getLogo">
<fo:external-graphic src="url({invoice/images/logo})"/>
</xsl:template>
Or even better yet:
<xsl:template match="logo">
<fo:external-graphic src="url({.})"/>
</xsl:template>
If you absolutely must use the two templates, why not something like
(might vary a bit depending on how you treat namespaces I think) :
<xsl:template name="logo">
<xsl:value-of select="invoice/images/logo"/>
</xsl:template>
<xsl:template name="getLogo">
<xsl:element name="fo:external-graphic">
<xsl:attribute name="src">
<xsl:text>url(</xsl:text>
<xsl:call-template name="logo"/>
<xsl:text>)</xsl:text>
</xsl:attribute>
</xsl:element>
</xsl:template>
Plus, you may want to keep in mind the earlier advice on this list
about not all processors working with the path information you're
using. Try to provide an actual url (should have that file:// on the
start)
Jon G.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








