Debian Codegraph @

docbook-xsl-ns/fo/fop.xsl

raw symbols SCIP
1 <?xml version='1.0' encoding="utf-8"?>
2 <xsl:stylesheet exclude-result-prefixes="d"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:d="http://docbook.org/ns/docbook"
5 xmlns:fo="http://www.w3.org/1999/XSL/Format"
6 xmlns:fox="http://xml.apache.org/fop/extensions"
7 version='1.0'>
8
9 <!-- ********************************************************************
10 (c) Stephane Bline Peregrine Systems 2001
11 Driver file to allow pdf bookmarking (based on fop implementation).
12 ******************************************************************** -->
13 <!--
14 In PDF bookmarks can't be used characters with code>255. This version of file
15 translates characters with code>255 back to ASCII.
16
17 Pavel Zampach ([email protected])
18 -->
19
20 <xsl:variable name="a-dia" select=
21 "'&#257;&#259;&#261;&#263;&#265;&#267;&#269;&#271;&#273;&#275;&#277;&#279;&#281;&#283;&#339;&#285;&#287;&#289;&#291;&#293;&#295;&#297;&#299;&#301;&#303;&#305;&#309;&#311;&#314;&#316;&#318;&#320;&#322;&#324;&#326;&#328;&#331;&#333;&#335;&#337;&#341;&#343;&#345;&#347;&#349;&#351;&#353;&#355;&#357;&#359;&#361;&#363;&#365;&#367;&#369;&#371;&#373;&#375;&#378;&#380;&#382;&#256;&#258;&#260;&#262;&#264;&#266;&#268;&#270;&#272;&#274;&#276;&#278;&#280;&#282;&#338;&#284;&#286;&#288;&#290;&#292;&#294;&#296;&#298;&#300;&#302;&#304;&#308;&#310;&#313;&#315;&#317;&#319;&#321;&#323;&#325;&#327;&#330;&#332;&#334;&#336;&#340;&#342;&#344;&#346;&#348;&#350;&#352;&#354;&#356;&#358;&#360;&#362;&#364;&#366;&#368;&#370;&#372;&#374;&#376;&#377;&#379;&#381;'"/>
22 <xsl:variable name="a-asc" select=
23 "'aaaccccddeeeeeegggghhiiiiijklllllnnnnooorrrsssstttuuuuuuwyzzzAAACCCCDDEEEEEEGGGGHHIIIIIJKLLLLLNNNNOOORRRSSSSTTTUUUUUUWYYZZZ'"/>
24
25 <xsl:template match="*" mode="fop.outline">
26 <xsl:variable name="id">
27 <xsl:value-of select="(@id|@xml:id)[1]"/>
28 </xsl:variable>
29 <xsl:if test="$id != ''">
30 <fox:destination internal-destination="{$id}"/>
31 </xsl:if>
32 <xsl:apply-templates select="*" mode="fop.outline"/>
33 </xsl:template>
34
35 <xsl:template match="d:set|d:book|d:part|d:reference|d:preface|d:chapter|d:appendix|d:article
36 |d:glossary|d:bibliography|d:index|d:setindex
37 |d:refentry
38 |d:sect1|d:sect2|d:sect3|d:sect4|d:sect5|d:section"
39 mode="fop.outline">
40 <xsl:variable name="id">
41 <xsl:call-template name="object.id"/>
42 </xsl:variable>
43 <xsl:variable name="bookmark-label">
44 <xsl:apply-templates select="." mode="object.title.markup"/>
45 </xsl:variable>
46
47 <!-- Put the root element bookmark at the same level as its children -->
48 <!-- If the object is a set or book, generate a bookmark for the toc -->
49
50 <xsl:choose>
51 <xsl:when test="self::d:index and $generate.index = 0"/>
52 <xsl:when test="parent::*">
53 <fox:outline internal-destination="{$id}">
54 <fox:label>
55 <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
56 </fox:label>
57 <xsl:apply-templates select="*" mode="fop.outline"/>
58 </fox:outline>
59 </xsl:when>
60 <xsl:otherwise>
61 <fox:outline internal-destination="{$id}">
62 <fox:label>
63 <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
64 </fox:label>
65 </fox:outline>
66
67 <xsl:variable name="toc.params">
68 <xsl:call-template name="find.path.params">
69 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
70 </xsl:call-template>
71 </xsl:variable>
72
73 <xsl:if test="contains($toc.params, 'toc')
74 and (d:book|d:part|d:reference|d:preface|d:chapter|d:appendix|d:article
75 |d:glossary|d:bibliography|d:index|d:setindex
76 |d:refentry
77 |d:sect1|d:sect2|d:sect3|d:sect4|d:sect5|d:section)">
78 <fox:outline internal-destination="toc...{$id}">
79 <fox:label>
80 <xsl:call-template name="gentext">
81 <xsl:with-param name="key" select="'TableofContents'"/>
82 </xsl:call-template>
83 </fox:label>
84 </fox:outline>
85 </xsl:if>
86 <xsl:apply-templates select="*" mode="fop.outline"/>
87 </xsl:otherwise>
88 </xsl:choose>
89 <fox:destination internal-destination="{$id}"/>
90 </xsl:template>
91
92 </xsl:stylesheet>
93