OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Conditionals in TOCs


Hello again everyone

 

Something I’ve been trying to hammer out in my stylesheet is how to control some of the output in the TOCs that my book has.

 

I have a book which has a main TOC and then each chapter in the book has its own TOC as well. 

 

I need the main TOC to only list chapter/title  and the chapter TOCs to list only chapter/sect1/title or chapter/sect2/title or chapter/sect3/title

 

The main TOC is also bolded and the chapter TOCs are not.

 

To get this to work I’ve been modeling the XSLT code below:

 

            <xsl:template name="toc.line">

                        <xsl:param name="pageclass" select="''"/>

                        <xsl:param name="sequence" select="''"/>

                        <xsl:param name="position" select="''"/>

                        <xsl:param name="gentext-key" select="''"/>

                        <xsl:variable name="id">

                                    <xsl:call-template name="object.id"/>

                        </xsl:variable>

                        <xsl:variable name="label">

                                    <xsl:apply-templates select="." mode="label.markup"/>

                        </xsl:variable>

                        <fo:block text-align-last="justify" text-align="start" end-indent="1in + {$toc.indent.width}pt" last-line-end-indent="-{$toc.indent.width}pt" font-family="{$body.font.family}" span="all">

                                    <xsl:choose>

                                                <xsl:when test="self::chapter or self::preface or self::appendix">

                                                            <xsl:attribute name="space-before">4pt</xsl:attribute>

                                                            <xsl:attribute name="space-after">4pt</xsl:attribute>

                                                </xsl:when>

                                                <xsl:when test="self::sect1">

                                                            <xsl:attribute name="space-before">4pt</xsl:attribute>

                                                </xsl:when>

                                    </xsl:choose>

                                    <fo:inline keep-with-next.within-line="always">

                                                <xsl:choose>

                                                            <xsl:when test="self::chapter or self::preface or self::appendix">

                                                                        <xsl:attribute name="font-weight">bold</xsl:attribute>

                                                            </xsl:when>

                                                </xsl:choose>

                                                <fo:basic-link internal-destination="{$id}">

                                                            <xsl:if test="$label != ''">

                                                                        <xsl:copy-of select="$label"/>

                                                                        <xsl:value-of select="$autotoc.label.separator"/>

                                                            </xsl:if>

                                                            <xsl:apply-templates select="." mode="titleabbrev.markup"/>

                                                </fo:basic-link>

                                    </fo:inline>

                                    <fo:inline keep-together.within-line="always">

                                                <xsl:text> </xsl:text>

                                                <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/>

                                                <xsl:text> </xsl:text>

                                                <fo:basic-link internal-destination="{$id}">

                                                            <fo:page-number-citation ref-id="{$id}" font-family="{$body.font.family}"/>

                                                </fo:basic-link>

                                    </fo:inline>

                        </fo:block>

            </xsl:template>

 

However, my question is: how can I get these params

 

                        <xsl:param name="pageclass" select="''"/>

                        <xsl:param name="sequence" select="''"/>

                        <xsl:param name="position" select="''"/>

                        <xsl:param name="gentext-key" select="''"/>

 

 

To have values?  When I output them they are blank in the above template…

 

Thanks,

 

David White



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]