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 11:20:14 +0530
Hi,
       That should be more starightforward.

You can do this as follows:

<xsl:template match="Graphics">
<fo:block>
<fo:external-graphic height="40mm" width="40mm">
<xsl:attribute name="src"
<xsl:value-of select="."/>
</xsl:attribute>
</fo:external-graphic>

</fo:block>
</xsl:template>

Hope this helps.

Cheers,
prakash



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




Sorry the last mail was sent by mistake

my xml is:

<CoverPage>
             <Graphics>C:\baby.bmp</Graphics>
    <Title>Cover Page</Title>
</CoverPage>

my xsl is:

<xsl:template match="CoverPage">
      <fo:block break-after="page">
                    <xsl:apply-templates select="Graphics"/>
                    <xsl:apply-templates select="Title"/>
         <xsl:apply-templates select="CoverPageText"/>
       </fo:block>
 </xsl:template>

<xsl:template match="Graphics">
<fo:block>
<fo:external-graphic src="" height="40mm"
width="40mm"/>
</fo:block>
</xsl:template>

My problem is how to refer to the graphic location
specified in the xml, in the src attribute of
fo:externalgraphic of xsl stylesheet(I left it blank).

Thanks
Bharathi

--- omprakash.v@xxxxxxxxxxxxx wrote:

>
>
>
>
>
> 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
>
>


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



____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs





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