Debian Codegraph @

demo/legacypdf/xslfo/toc2fo.xsl

raw symbols SCIP
1 <?xml version='1.0'?>
2 <!-- This file is part of the DITA Open Toolkit project hosted on
3 Sourceforge.net. See the accompanying license.txt file for
4 applicable licenses.-->
5 <!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
6
7 <!-- This stylesheet is a part of the Serna Interactive Example. -->
8
9 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 xmlns:fo="http://www.w3.org/1999/XSL/Format"
11 xmlns:se="http://www.syntext.com/XSL/Format-1.0"
12 version='1.0'>
13
14 <!-- Make a Table of Contents -->
15 <xsl:template name="make.toc">
16 <fo:block background-color="#e0e0e0">
17 <fo:block font-size="20pt" font-weight="bold">
18 <xsl:text>Table of Contents:</xsl:text>
19 </fo:block>
20 <xsl:apply-templates mode="toc" select="topic" se:sections="omit"/>
21 </fo:block>
22 </xsl:template>
23
24 <xsl:template match="*[contains(@class, ' topic/title ')]" mode="toc">
25 <fo:block start-indent="{count(ancestor-or-self::topic) * 10}pt">
26 <xsl:number count="sect" format="1. " level="multiple"/>
27 <xsl:apply-templates select="text()"/>
28 </fo:block>
29 </xsl:template>
30
31 <xsl:template match="*[contains(@class, ' topic/topic ')]" mode="toc">
32 <xsl:apply-templates mode="toc" select="*[self::sect or self::title]"/>
33 </xsl:template>
34
35 </xsl:stylesheet>