Re: [xsl] Specifying the src attribute for <fo:externalgraphic>

Subject: Re: [xsl] Specifying the src attribute for <fo:externalgraphic>
From: omprakash.v@xxxxxxxxxxxxx
Date: Mon, 22 Aug 2005 10:09:43 +0530
Hi,
 You mean the original xml would have markers in place of actual location
and later you would replace the markers with the actual location like
below:

main.xml:

<foo>
<img id="img1"/>
</foo>

and in imgpath.xml you would have

<images>
<img id="img1" path="c:\images\ball.gif"/>
</images>

In the above case you could use the document function to load the second
xml into your xslt as follows:

<xsl:variable name="imgpaths" select="document('imgpath.xml')"/>

<xsl:template match="img">

<xsl:variable name="imgid" select="@id"/>

<fo:external-graphic>
<xsl:attribute name="src">
<xsl:value-of select="concat('URI(', $imgpaths/images/img/@path[@id =
$imgid], ')')"/>
</xsl:attribute>
</fo:external-graphic>
</xsl:template>


Hope this helps.

cheers,
prakash







                                                                                                                                       
                      bharathi kongara                                                                                                 
                      <bharathikongara         To:      xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                                
                      @yahoo.com>              cc:      (bcc: omprakash.v/Polaris)                                                     
                                               Subject: [xsl] Specifying the src attribute for <fo:externalgraphic>                    
                      08/22/2005 09:25                                                                                                 
                      AM                                                                                                               
                      Please respond                                                                                                   
                      to xsl-list                                                                                                      
                                                                                                                                       
                                                                                                                                       




Hi

I want to get the src attribute for
<fo:externalgraphic> in xsl stylesheet from an xml
document. I mean the location of the graphic would be
specified in the xml document, and my style sheet
should be able to get that location while it is
converting xml to xsl-fo.(This is because the
locations are generated dynamically by my Java
program, I cannot hardcode them into the stylesheet).
Do anyone know how to specify the src attribute in
this case? Any help would be greatly appreciated

Bharathi

Bharathi Kongara,
Graduate Student,
Department of Computer Science,
Utah State University,
Logan,UT 84321

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com





This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

Current Thread