From: Norman W. <nw...@us...> - 2002-03-19 01:19:19
|
Update of /cvsroot/docbook/xsl/fo In directory usw-pr-cvs1:/tmp/cvs-serv11966 Modified Files: autotoc.xsl Log Message: Make sure ToC elements have IDs for links from the PDF ToC Index: autotoc.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/fo/autotoc.xsl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** autotoc.xsl 14 Mar 2002 18:43:34 -0000 1.6 --- autotoc.xsl 19 Mar 2002 01:19:15 -0000 1.7 *************** *** 52,60 **** <xsl:template name="component.toc"> <xsl:variable name="nodes" select="section|sect1|refentry |article|bibliography|glossary |appendix"/> <xsl:if test="$nodes"> ! <fo:block xsl:use-attribute-sets="toc.margin.properties"> <xsl:call-template name="table.of.contents.titlepage"/> <xsl:apply-templates select="$nodes" mode="toc"/> --- 52,65 ---- <xsl:template name="component.toc"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:variable name="nodes" select="section|sect1|refentry |article|bibliography|glossary |appendix"/> <xsl:if test="$nodes"> ! <fo:block id="toc...{$id}" ! xsl:use-attribute-sets="toc.margin.properties"> <xsl:call-template name="table.of.contents.titlepage"/> <xsl:apply-templates select="$nodes" mode="toc"/> *************** *** 143,150 **** <xsl:template match="reference" mode="toc"> <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 0 and refentry"> ! <fo:block start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="refentry" mode="toc"/> </fo:block> --- 148,160 ---- <xsl:template match="reference" mode="toc"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 0 and refentry"> ! <fo:block id="toc...{$id}" ! start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="refentry" mode="toc"/> </fo:block> *************** *** 158,161 **** --- 168,175 ---- <xsl:template match="preface|chapter|appendix|article" mode="toc"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:call-template name="toc.line"/> *************** *** 163,167 **** <xsl:if test="$toc.section.depth > 0 and $nodes"> ! <fo:block start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="$nodes" mode="toc"/> </fo:block> --- 177,182 ---- <xsl:if test="$toc.section.depth > 0 and $nodes"> ! <fo:block id="toc...{$id}" ! start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="$nodes" mode="toc"/> </fo:block> *************** *** 170,177 **** <xsl:template match="sect1" mode="toc"> <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 1 and sect2"> ! <fo:block start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect2" mode="toc"/> </fo:block> --- 185,197 ---- <xsl:template match="sect1" mode="toc"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 1 and sect2"> ! <fo:block id="toc...{$id}" ! start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect2" mode="toc"/> </fo:block> *************** *** 180,187 **** <xsl:template match="sect2" mode="toc"> <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 2 and sect3"> ! <fo:block start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect3" mode="toc"/> </fo:block> --- 200,212 ---- <xsl:template match="sect2" mode="toc"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 2 and sect3"> ! <fo:block id="toc...{$id}" ! start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect3" mode="toc"/> </fo:block> *************** *** 190,197 **** <xsl:template match="sect3" mode="toc"> <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 3 and sect4"> ! <fo:block start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect4" mode="toc"/> </fo:block> --- 215,227 ---- <xsl:template match="sect3" mode="toc"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 3 and sect4"> ! <fo:block id="toc...{$id}" ! start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect4" mode="toc"/> </fo:block> *************** *** 200,207 **** <xsl:template match="sect4" mode="toc"> <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 4 and sect5"> ! <fo:block start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect5" mode="toc"/> </fo:block> --- 230,242 ---- <xsl:template match="sect4" mode="toc"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 4 and sect5"> ! <fo:block id="toc...{$id}" ! start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect5" mode="toc"/> </fo:block> *************** *** 214,217 **** --- 249,256 ---- <xsl:template match="section" mode="toc"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:variable name="depth" select="count(ancestor::section) + 1"/> *************** *** 220,224 **** <xsl:if test="$toc.section.depth > $depth"> ! <fo:block start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="section" mode="toc"/> </fo:block> --- 259,264 ---- <xsl:if test="$toc.section.depth > $depth"> ! <fo:block id="toc...{$id}" ! start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="section" mode="toc"/> </fo:block> *************** *** 249,254 **** <xsl:param name="nodes" select=".//table"/> <xsl:if test="$nodes"> ! <fo:block> <xsl:choose> <xsl:when test="$titles='table'"> --- 289,298 ---- <xsl:param name="nodes" select=".//table"/> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:if test="$nodes"> ! <fo:block id="lot...{$titles}...{$id}"> <xsl:choose> <xsl:when test="$titles='table'"> |