W3C home > Mailing lists > Public > www-xsl-fo@w3.org > May 2003

dynamic external svg images

From: Ai, Larry <lai@cas.org>
Date: Fri, 30 May 2003 15:01:28 -0400
Message-ID: <0DBCFBC9A19A294DA1F7128209329BED010730D5@ntexch02.intra.cas.org>
To: "'www-xsl-fo@w3.org'" <www-xsl-fo@w3.org>

I need to generate svg xml document on the fly.

Here is what I have done so far:

In the ConvertSVG.Java file:

// the svg image is hardcoded for testing

 StringBuffer svg = new StringBuffer();
 svg.append("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"400\" height=\"400\">");
 svg.append("<g style=\"fill:red; stroke:#000000\">");
 svg.append("<rect x=\"0\" y=\"0\" width=\"15\" height=\"15\"/>");
 svg.append("</g>");
 svg.append("</svg>");
        
 return svg.toString();
    

In the getsvg.xsl file:

    <lxslt:component prefix="convert" functions="ConvertSVG">
        <lxslt:script lang="javaclass" src="ConvertSVG"/>
    </lxslt:component>

    <xsl:template name="getsvg">
        <xsl:value-of select="convert:getSVG()"/>
    </xsl:template>

in the xsl-fo file:

    <xsl:import href="getsvg.xsl"/>
    ...
    <fo:instream-foreigh-object>
	<xsl:call-template name="getsvg"/>
    </fo:instream-foreigh-object>

It does not work!

Anyone knows what I did wrong?

Thanks!

Larry
Received on Friday, 30 May 2003 15:02:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:10 GMT