El Martes, 17 de Julio de 2007 10:19, Marie Sauvage - EBM
WebSourcing
escribió:
> Hi !
>
> I would like the terms of the variablelists to look
like varname. As I
> have many variablelists, it's heavy to add the varname
markup at each
> variable, so I wonder if it is possible to set the font
to those elements
> in my custom xsl stylesheet ? I would like to do it in
the html output and
> the pdf output, which I generate via fop 0.93. I'm
using DocBook
> stylesheets 1.72 ; I've tried to look in lists.xml but
don't find if and
> where I could do it...
Try this.
For FO:
<xsl:template match="varlistentry/term">
<fo:inline
xsl:use-attribute-sets="monospace.properties">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</fo:inline>
<xsl:choose>
<xsl:when
test="not(following-sibling::term)"/>
<xsl:otherwise>
<fo:inline><xsl:value-of
select="$variablelist.term.separator"/></fo:
inline>
<xsl:if
test="not($variablelist.term.break.after =
'0')">
<fo:block/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
For HTML you can customize the tagging like this:
<xsl:template match="varlistentry/term">
<code class="term">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>
<xsl:value-of
select="$variablelist.term.separator"/>
<xsl:if
test="not($variablelist.term.break.after =
'0')">
<br/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</code>
</xsl:template>
or, if using a CSS file to style the HTMLs, just add this
snip to it:
span.term { font-family: monospace; }
--
Manuel Canales Esparcia
Usuario de LFS nº2886: http://www.linuxfroms
cratch.org
LFS en castellano: http://www.escomp
oslinux.org/lfs-es http://www.lfs-es.info
TLDP-ES: http://es.tldp.org
------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribe lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help lists.oasis-open.org
|