[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] Fo question
The handling of the part element in fo is different from other division
type elements because the children of part (chapter, appendix, etc.)
generate page sequences, and you cannot nest page-sequence in XSL-FO. The
part template must generate only the part divider pages. This requires the
template handling part to generate whatever page-sequences it needs for its
titlepage, partintro, and TOC, close the last page-sequence, and then
apply-templates to its other children to allow them to generate their own
page-sequences. That's different from the nesting of FO elements that is
done for almost all other elements.
So the part templates are a bit confusing at first, especially since the
handling is different if there is a partintro present. If you don't use a
partintro, then you can replace the original part template from
fo/division.xsl:
<xsl:template match="part">
<xsl:if test="not(partintro)">
<xsl:apply-templates select="." mode="part.titlepage.mode"/>
<xsl:call-template name="generate.part.toc"/>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
with this customization:
<xsl:template match="part">
<xsl:if test="not(partintro)">
<xsl:apply-templates select="." mode="part.titlepage.mode">
<xsl:with-param name="additional.content">
<xsl:call-template name="division.toc"/>
</xsl:with-param>
</xsl:apply-templates>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
The "part.titlepage.mode" template is used to generate the page sequence
for the part title page. Normally it calls generate.part.toc after that
page sequence, and generate.part.toc creates its own page-sequence too,
which is why the toc was on a separate odd-numbered page.
The customization uses the "additional.content" parameter to put the
division.toc (which is what generate.part.toc used to create the actual
TOC) on the titlepage itself, and does not call generate.part.toc after the
titlepage.
If you are using a partintro, you'll need to trace through that template to
see where to apply this customization.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "Sean Wheller" <sean@inwords.co.za>
To: "Stefan Mueller" <stefan@held-mueller.de>
Cc: <docbook@lists.oasis-open.org>
Sent: Monday, October 23, 2006 7:36 AM
Subject: Re: [docbook] Fo question
> On Sunday 22 October 2006 22:35, Stefan Mueller wrote:
>> Thanks for your help. It is a first hint.
>>
>> How do I get the TOC on the same page as "part"-page headline?
>
> Actually I am not sure, would be interested to find out.
> --
> Ask me about the Monkey.
>
> Sean Wheller
> Technical Author
> sean@inwords.co.za
> +27-84-854-9408
> http://www.inwords.co.za
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-help@lists.oasis-open.org
>
>
>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]