xsl-list
[Top] [All Lists]

Re: Specifying the src attribute for <fo:externalgraphic>

2005-08-21 22:44:29
"Bharathi" == bharathi kongara <bharathikongara(_at_)yahoo(_dot_)com> 
writes:

    Bharathi> Sorry the last mail was sent by mistake my xml is:

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

    Bharathi> my xsl is:

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

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

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

Well, the first thing to note is that the src attribute must take a
URI, not a file name.

So, assuming you can correct your xml file to specify a url rather
than a file name, you can then use xsl:element plus xsl:attribute 
(instead of coding fo:external-graphic as a literal result element).

Within the xsl:attribute for the src attribute, you can specify
select="CoverPage/Graphics/text()".
-- 
Colin Adams
Preston Lancashire

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--