[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl display graphic from xml

Subject: Re: xsl display graphic from xml
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Thu, 7 Apr 2005 13:37:25 -0500
xsl graphic
> 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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.