[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Formal titles as a float
Hello,
As you discovered, when you use xsl:apply-imports,
it applies the default template with match="task" in fo/task.xsl, which
calls formal.object.heading, which duplicates your use of the same
template. You could customize the match="task" template to remove the call
to formal.object.heading, or you could customize formal.object.heading to do
something different for task and lists. Something like this:
<xsl:template
name="formal.object.heading">
<xsl:param name="object" select="."/> <xsl:param name="placement" select="'before'"/> <xsl:variable
name="content">
<fo:block xsl:use-attribute-sets="formal.title.properties"> <xsl:choose> <xsl:when test="$placement = 'before'"> <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="keep-with-previous.within-column">always</xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="$object" mode="object.title.markup"> <xsl:with-param name="allow-anchors" select="1"/> </xsl:apply-templates> </fo:block> </xsl:variable> <xsl:choose>
<xsl:when test="$object/self::task or $object/self::orderedlist or $object/self::itemizedlist"> <xsl:call-template name="floater"> <xsl:with-param name="position">left</xsl:with-param> <xsl:with-param name="width">0.7in</xsl:with-param> <xsl:with-param name="start.indent">0in</xsl:with-param> <xsl:with-param name="content"> <fo:block margin-top="1em" text-align="left" padding="3pt">
<xsl:copy-of
select="$content"/>
</fo:block> </xsl:with-param> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$content"/> </xsl:otherwise> </xsl:choose> </xsl:template> This first formats the title into a
$content variable, and then uses an xsl:choose statement to put that
$content into a float or not, depending on the $object being
processed.
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]