OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: DOCBOOK-APPS: XSL support for callout graphics


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/


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC