On Mar 7, 2007, at 12:07, Braumüller, Hans wrote:
Hi,
what is the straightforward way to generate in xsl-fo an Table of
Contents three-level with corresponding links ?
The trick is to use a combination of:
<fo:basic-link internal-destination="..." />
<fo:page-number-citation ref-id="..." />
<fo:block id="..." />
The first two are used to make up the TOC itself. The third serves as
an anchor to which the basic-link can point, and from where the page-
number is to be retrieved.
In your example, the template to generate the TOC would look roughly
like:
<xsl:template match="/apl/klasse/funktion" mode="toc">
<fo:block text-align="justify" text-align-last="justify">
<fo:basic-link internal-destination="generate-id(.)">
<xsl:value-of select="name" />
<fo:leader leader-pattern="dots" />
<fo:page-number-citation ref-id="generate-id(.)" />
</fo:basic-link>
</fo:block>
</xsl:template>
and then, when generating the blocks, make sure that the
corresponding id is added to them:
<xsl:template match="...">
<xsl:variable name="funktion-id"
select="generate-id($XPath_to_corresponding_funktion
$)" />
<fo:block id="{$funktion-id}">
...
</fo:block>
</xsl:template>
HTH!
Cheers,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]