Re: [xsl] fo:external-graphic and xml:base

Subject: Re: [xsl] fo:external-graphic and xml:base
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Sun, 22 Nov 2009 16:21:26 +0000 (GMT)
Jack Bates wrote:

  Hi,

>   <xsl:template match="html:img">
>
<fo:external-graphic src="url('{@src}')"/>
>   </xsl:template>

  By doing so,
you put the string value of the attribute @src in
the result tree.  So you
actually loose its base URI.  What you
want is to resolve its string value as
a URI, and against the
base URI of the node it is a value of:
<xsl:template match="html:img">
       <fo:external-graphic src="
url('{ resolve-uri(@src, base-uri(.)) }') "/>
    </xsl:template>

  But I've
just seen you are using XSLT 1.0, and those functions
are in XPath 2.0.  I do
not know in XSLT 1.0...

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/

Current Thread