| 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 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
<xsl:variable name="a-dia" select= |
| 21 |
"'āăąćĉċčďđēĕėęěœĝğġģĥħĩīĭįıĵķĺļľŀłńņňŋōŏőŕŗřśŝşšţťŧũūŭůűųŵŷźżžĀĂĄĆĈĊČĎĐĒĔĖĘĚŒĜĞĠĢĤĦĨĪĬĮİĴĶĹĻĽĿŁŃŅŇŊŌŎŐŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽ'"/> |
| 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 |
|
| 48 |
|
| 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 |
|