| [9882b55] | 1 | <?xml version='1.0'?> | 
|---|
|  | 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:template match="*" mode="fop1.outline"> | 
|---|
|  | 7 | <xsl:apply-templates select="*" mode="fop1.outline"/> | 
|---|
|  | 8 | </xsl:template> | 
|---|
|  | 9 |  | 
|---|
|  | 10 | <xsl:template match="set|book|part|reference| | 
|---|
|  | 11 | preface|chapter|appendix|article | 
|---|
|  | 12 | |glossary|bibliography|index|setindex | 
|---|
|  | 13 | |refentry | 
|---|
|  | 14 | |sect1|sect2|sect3|sect4|sect5|section" | 
|---|
|  | 15 | mode="fop1.outline"> | 
|---|
|  | 16 |  | 
|---|
|  | 17 | <xsl:variable name="id"> | 
|---|
|  | 18 | <xsl:call-template name="object.id"/> | 
|---|
|  | 19 | </xsl:variable> | 
|---|
|  | 20 | <xsl:variable name="bookmark-label"> | 
|---|
|  | 21 | <xsl:apply-templates select="." mode="object.title.markup"/> | 
|---|
|  | 22 | </xsl:variable> | 
|---|
|  | 23 |  | 
|---|
|  | 24 | <!-- Put the root element bookmark at the same level as its children --> | 
|---|
|  | 25 | <!-- If the object is a set or book, generate a bookmark for the toc --> | 
|---|
|  | 26 |  | 
|---|
|  | 27 | <xsl:choose> | 
|---|
|  | 28 | <xsl:when test="parent::*"> | 
|---|
|  | 29 | <fo:bookmark internal-destination="{$id}"> | 
|---|
|  | 30 | <fo:bookmark-title> | 
|---|
|  | 31 | <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/> | 
|---|
|  | 32 | </fo:bookmark-title> | 
|---|
|  | 33 | <xsl:apply-templates select="*" mode="fop1.outline"/> | 
|---|
|  | 34 | </fo:bookmark> | 
|---|
|  | 35 | </xsl:when> | 
|---|
|  | 36 | <xsl:otherwise> | 
|---|
|  | 37 | <fo:bookmark internal-destination="{$id}"> | 
|---|
|  | 38 | <fo:bookmark-title> | 
|---|
|  | 39 | <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/> | 
|---|
|  | 40 | </fo:bookmark-title> | 
|---|
|  | 41 | </fo:bookmark> | 
|---|
|  | 42 |  | 
|---|
|  | 43 | <xsl:variable name="toc.params"> | 
|---|
|  | 44 | <xsl:call-template name="find.path.params"> | 
|---|
|  | 45 | <xsl:with-param name="table" select="normalize-space($generate.toc)"/> | 
|---|
|  | 46 | </xsl:call-template> | 
|---|
|  | 47 | </xsl:variable> | 
|---|
|  | 48 |  | 
|---|
|  | 49 | <xsl:if test="contains($toc.params, 'toc') | 
|---|
|  | 50 | and (book|part|reference|preface|chapter|appendix|article | 
|---|
|  | 51 | |glossary|bibliography|index|setindex | 
|---|
|  | 52 | |refentry | 
|---|
|  | 53 | |sect1|sect2|sect3|sect4|sect5|section)"> | 
|---|
|  | 54 | <fo:bookmark internal-destination="toc...{$id}"> | 
|---|
|  | 55 | <fo:bookmark-title> | 
|---|
|  | 56 | <xsl:call-template name="gentext"> | 
|---|
|  | 57 | <xsl:with-param name="key" select="'TableofContents'"/> | 
|---|
|  | 58 | </xsl:call-template> | 
|---|
|  | 59 | </fo:bookmark-title> | 
|---|
|  | 60 | </fo:bookmark> | 
|---|
|  | 61 | </xsl:if> | 
|---|
|  | 62 | <xsl:apply-templates select="*" mode="fop1.outline"/> | 
|---|
|  | 63 | </xsl:otherwise> | 
|---|
|  | 64 | </xsl:choose> | 
|---|
|  | 65 | <!-- | 
|---|
|  | 66 | <fo:bookmark internal-destination="{$id}"/> | 
|---|
|  | 67 | --> | 
|---|
|  | 68 | </xsl:template> | 
|---|
|  | 69 |  | 
|---|
|  | 70 |  | 
|---|
|  | 71 | </xsl:stylesheet> | 
|---|