1 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
2 | xmlns:fo="http://www.w3.org/1999/XSL/Format" |
---|
3 | version="1.0"> |
---|
4 | |
---|
5 | <!-- ================================================================ --> |
---|
6 | <!-- --> |
---|
7 | <!-- PTC/Arbortext Code for XSL 1.1 bookmark support --> |
---|
8 | <!-- --> |
---|
9 | <!-- ================================================================ --> |
---|
10 | |
---|
11 | <xsl:param name="ati.xsl11.bookmarks" select="1"/> |
---|
12 | |
---|
13 | <xsl:variable name="ati-a-dia" select= |
---|
14 | "'āăąćĉċčďđēĕėęěœĝğġģĥħĩīĭįıĵķĺļľŀłńņňŋōŏőŕŗřśŝşšţťŧũūŭůűųŵŷźżžĀĂĄĆĈĊČĎĐĒĔĖĘĚŒĜĞĠĢĤĦĨĪĬĮİĴĶĹĻĽĿŁŃŅŇŊŌŎŐŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽ'"/> |
---|
15 | |
---|
16 | <xsl:variable name="ati-a-asc" select= |
---|
17 | "'aaaccccddeeeeeegggghhiiiiijklllllnnnnooorrrsssstttuuuuuuwyzzzAAACCCCDDEEEEEEGGGGHHIIIIIJKLLLLLNNNNOOORRRSSSSTTTUUUUUUWYYZZZ'"/> |
---|
18 | |
---|
19 | <xsl:template match="*" mode="ati.xsl11.bookmarks"> |
---|
20 | <xsl:apply-templates select="*" mode="ati.xsl11.bookmarks"/> |
---|
21 | </xsl:template> |
---|
22 | |
---|
23 | <xsl:template match="set|book|part|reference|preface|chapter|appendix|article |
---|
24 | |glossary|bibliography|index|setindex |
---|
25 | |refentry |
---|
26 | |sect1|sect2|sect3|sect4|sect5|section" |
---|
27 | mode="ati.xsl11.bookmarks"> |
---|
28 | <xsl:variable name="id"> |
---|
29 | <xsl:call-template name="object.id"/> |
---|
30 | </xsl:variable> |
---|
31 | <xsl:variable name="bookmark-label"> |
---|
32 | <xsl:apply-templates select="." mode="object.title.markup"/> |
---|
33 | </xsl:variable> |
---|
34 | |
---|
35 | <!-- Put the root element bookmark at the same level as its children --> |
---|
36 | <!-- If the object is a set or book, generate a bookmark for the toc --> |
---|
37 | |
---|
38 | <xsl:choose> |
---|
39 | <xsl:when test="parent::*"> |
---|
40 | <fo:bookmark internal-destination="{$id}"> |
---|
41 | <fo:bookmark-title> |
---|
42 | <xsl:value-of select="translate($bookmark-label, $ati-a-dia, $ati-a-asc)"/> |
---|
43 | </fo:bookmark-title> |
---|
44 | <xsl:apply-templates select="*" mode="ati.xsl11.bookmarks"/> |
---|
45 | </fo:bookmark> |
---|
46 | </xsl:when> |
---|
47 | <xsl:otherwise> |
---|
48 | <fo:bookmark internal-destination="{$id}"> |
---|
49 | <fo:bookmark-title> |
---|
50 | <xsl:value-of select="translate($bookmark-label, $ati-a-dia, $ati-a-asc)"/> |
---|
51 | </fo:bookmark-title> |
---|
52 | </fo:bookmark> |
---|
53 | |
---|
54 | <xsl:variable name="toc.params"> |
---|
55 | <xsl:call-template name="find.path.params"> |
---|
56 | <xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
---|
57 | </xsl:call-template> |
---|
58 | </xsl:variable> |
---|
59 | <xsl:if test="contains($toc.params, 'toc') |
---|
60 | and section|sect1|refentry |
---|
61 | |article|bibliography|glossary |
---|
62 | |appendix"> |
---|
63 | <fo:bookmark internal-destination="toc...{$id}"> |
---|
64 | <fo:bookmark-title> |
---|
65 | <xsl:call-template name="gentext"> |
---|
66 | <xsl:with-param name="key" select="'TableofContents'"/> |
---|
67 | </xsl:call-template> |
---|
68 | </fo:bookmark-title> |
---|
69 | </fo:bookmark> |
---|
70 | </xsl:if> |
---|
71 | <xsl:apply-templates select="*" mode="ati.xsl11.bookmarks"/> |
---|
72 | </xsl:otherwise> |
---|
73 | </xsl:choose> |
---|
74 | </xsl:template> |
---|
75 | |
---|
76 | </xsl:stylesheet> |
---|