874211efdd1f63776b0588f62b9e3372b415771d
[claws.git] / manual / dtd / manual.xsl
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4                 version="1.0">
5
6 <xsl:import href="@DOCBOOK_XSL_PATH@/fo/docbook.xsl"/>
7
8 <xsl:param name="fop1.extensions" select="1"/>
9 <xsl:param name="title.margin.left" select="'0pt'"/>
10 <xsl:param name="body.start.indent" select="'0pt'"/>
11 <xsl:param name="variablelist.as.blocks" select="1"/>
12 <xsl:param name="paper.type" select="'A4'"/>
13
14 <xsl:template match="appendix[@id='ap_glossary']/variablelist"
15               mode="fop1.outline">
16
17   <xsl:variable name="id">
18     <xsl:call-template name="object.id"/>
19   </xsl:variable>
20   
21   <xsl:variable name="bookmark-label">
22     <xsl:apply-templates select="." mode="object.title.markup"/>
23   </xsl:variable>
24
25   <!-- Put the root element bookmark at the same level as its children -->
26   <!-- If the object is a set or book, generate a bookmark for the toc -->
27
28   <xsl:choose>
29     <xsl:when test="parent::*">
30       <fo:bookmark internal-destination="{$id}">
31         <fo:bookmark-title>
32           <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
33         </fo:bookmark-title>
34         <xsl:apply-templates select="*" mode="fop1.outline"/>
35       </fo:bookmark>
36     </xsl:when>
37     <xsl:otherwise>
38       <fo:bookmark internal-destination="{$id}">
39         <fo:bookmark-title>
40           <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
41         </fo:bookmark-title>
42       </fo:bookmark>
43
44       <xsl:variable name="toc.params">
45         <xsl:call-template name="find.path.params">
46           <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
47         </xsl:call-template>
48       </xsl:variable>
49
50       <xsl:if test="contains($toc.params, 'toc')
51                     and (book|part|reference|preface|chapter|appendix|article
52                          |glossary|bibliography|index|setindex
53                          |refentry
54                          |sect1|sect2|sect3|sect4|sect5|section)">
55         <fo:bookmark internal-destination="toc...{$id}">
56           <fo:bookmark-title>
57             <xsl:call-template name="gentext">
58               <xsl:with-param name="key" select="'TableofContents'"/>
59             </xsl:call-template>
60           </fo:bookmark-title>
61         </fo:bookmark>
62       </xsl:if>
63       <xsl:apply-templates select="*" mode="fop1.outline"/>
64     </xsl:otherwise>
65   </xsl:choose>
66 </xsl:template>
67
68 </xsl:stylesheet>