This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
XSL support for callout graphics
- To: docbook <docbook-apps at lists dot oasis-open dot org>
- Subject: DOCBOOK-APPS: XSL support for callout graphics
- From: pilgrim_mark at yahoo dot com
- Date: Thu, 16 Nov 2000 10:56:33 -0800 (PST)
I notice in the DocBook XSL stylesheets 1.24
distribution, the images/callouts/ directory contains
images for callouts, but in html/callout.xsl,
<xsl:template match="co" mode="callout-bug"> specifies
a text-only callout, so the images are never used.
Here is some sample code that I have in my custom
stylesheet that overrides this template to provide
support for callout images. Feel free to copy it
verbatim or use it as a starting point. Norm, can
something like this be integrated into the official
distribution?
<!-- new parameter (like those in param.xsl) to define
where callout images are stored -->
<xsl:param
name="co.graphics.path">../images/callouts/</xsl:param>
<!-- add support for callout graphics -->
<xsl:template name="co.graphic">
<xsl:param name="node" select="."/>
<xsl:param name="conum"/>
<xsl:value-of select="$co.graphics.path"/>
<xsl:value-of select="$conum"/>
<xsl:text>.png</xsl:text>
</xsl:template>
<xsl:template match="co" mode="callout-bug">
<xsl:variable name="conum">
<xsl:number count="co" format="1"/>
</xsl:variable>
<img border="0" height="12" width="12">
<xsl:attribute name="src">
<xsl:call-template name="co.graphic">
<xsl:with-param name="conum" select="$conum"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="alt"><xsl:number
value="$conum" format="(1)"/></xsl:attribute>
</img>
</xsl:template>
Share and enjoy.
-M
__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/