My xsl:
<xsl:template name="TOC"> <fo:block font-family="TimesNewRoman" space-after="12pt" id="Toc" line-height="21pt" font-size="18pt" text-align="start"> Table of Contents </fo:block> <xsl:for-each select="/Diplomová_práce/Kapitola/Nadpis"> <fo:block font-family="TimesNewRoman" text-align-last="justify" line-height="18pt" font-size="12pt" font-weight="bold" space-after="3pt" space-before="18pt" start-indent="0cm"> <xsl:number count="Kapitola/Nadpis" from="Diplomová_práce" level="any" format="1"/> <fo:basic-link color="blue"> <xsl:attribute name="internal-destination"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsl:when test="name(preceding-sibling::*[1]) = 'a' and preceding-sibling::[EMAIL PROTECTED]"> <xsl:value-of select="preceding-sibling::*[1]/@name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id()"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates select="*|text()"/> </fo:basic-link> <fo:leader leader-pattern="space"/> <fo:page-number-citation> <xsl:attribute name="ref-id"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsl:when test="name(preceding-sibling::*[1]) = 'a' and preceding-sibling::[EMAIL PROTECTED]"> <xsl:value-of select="preceding-sibling::*[1]/@name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id()"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> </fo:page-number-citation> </fo:block> <xsl:for-each select="..//Podkapitola/Nadpis"> <fo:block font-family="TimesNewRoman" text-align-last="justify" line-height="18pt" font-size="12pt" space-after="3pt" font-weight="normal" start-indent="0.5cm"> <xsl:number count="Kapitola/Nadpis" from="Diplomová_práce" level="any" format="1."/> <xsl:number count="Podkapitola/Nadpis" from="Kapitola" level="any" format="1"/> <fo:basic-link color="blue"> <xsl:attribute name="internal-destination"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsl:when test="name(preceding-sibling::*[1]) = 'a' and preceding-sibling::[EMAIL PROTECTED]"> <xsl:value-of select="preceding-sibling::*[1]/@name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id()"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates select="*|text()"/> </fo:basic-link> <fo:leader leader-pattern="dots"/> <fo:page-number-citation> <xsl:attribute name="ref-id"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsl:when test="name(preceding-sibling::*[1]) = 'a' and preceding-sibling::[EMAIL PROTECTED]"> <xsl:value-of select="preceding-sibling::*[1]/@name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id()"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> </fo:page-number-citation> </fo:block> <xsl:for-each select="..//Článek/Nadpis"> <fo:block font-family="TimesNewRoman" text-align-last="justify" line-height="18pt" font-size="12pt" space-after="3pt" start-indent="1cm"> <xsl:number count="Kapitola/Nadpis" from="Diplomová_práce" level="any" format="1."/> <xsl:number count="Podkapitola/Nadpis" from="Kapitola" level="any" format="1."/> <xsl:number count="Článek/Nadpis" from="Podkapitola" level="any" format="1"/> <fo:basic-link color="blue"> <xsl:attribute name="internal-destination"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsl:when test="name(preceding-sibling::*[1]) = 'a' and preceding-sibling::[EMAIL PROTECTED]"> <xsl:value-of select="preceding-sibling::*[1]/@name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id()"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates select="*|text()"/> </fo:basic-link> <fo:leader leader-pattern="dots"/> <fo:page-number-citation> <xsl:attribute name="ref-id"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsl:when test="name(preceding-sibling::*[1]) = 'a' and preceding-sibling::[EMAIL PROTECTED]"> <xsl:value-of select="preceding-sibling::*[1]/@name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id()"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> </fo:page-number-citation> </fo:block> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:template>
View this message in context: Re: TOC problem with text-align-last
Sent from the FOP - Users forum at Nabble.com.
