<!-- ********************************************************************
Pdf bookmarks
******************************************************************** -->
-<xsl:template match="set" mode="xep.outline">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
- <xsl:variable name="bookmark-label">
- <xsl:apply-templates select="." mode="label.content"/>
- <xsl:apply-templates select="." mode="title.content"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="parent::*">
- <xsl:if test="book">
- <xsl:apply-templates select="book"
- mode="xep.outline"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <rx:bookmark internal-destination="{$id}">
- <rx:bookmark-label>
- <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
- </rx:bookmark-label>
- <xsl:if test="book">
- <xsl:apply-templates select="book"
- mode="xep.outline"/>
- </xsl:if>
- </rx:bookmark>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="book" mode="xep.outline">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
- <xsl:variable name="bookmark-label">
- <xsl:apply-templates select="." mode="label.markup"/>
- <xsl:apply-templates select="." mode="title.markup"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="parent::*">
- <rx:bookmark internal-destination="{$id}">
- <rx:bookmark-label>
- <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
- </rx:bookmark-label>
- <xsl:if test="part|preface|chapter|appendix">
- <xsl:apply-templates select="part|preface|chapter|appendix"
- mode="xep.outline"/>
- </xsl:if>
- </rx:bookmark>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="part|preface|chapter|appendix">
- <xsl:apply-templates select="part|preface|chapter|appendix"
- mode="xep.outline"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="part" mode="xep.outline">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
- <xsl:variable name="bookmark-label">
- <xsl:apply-templates select="." mode="label.markup"/>
- <xsl:apply-templates select="." mode="title.markup"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="parent::*">
- <rx:bookmark internal-destination="{$id}">
- <rx:bookmark-label>
- <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
- </rx:bookmark-label>
- <xsl:if test="chapter|appendix|preface|reference">
- <xsl:apply-templates select="chapter|appendix|preface|reference"
- mode="xep.outline"/>
- </xsl:if>
- </rx:bookmark>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="chapter|appendix|preface|reference">
- <xsl:apply-templates select="chapter|appendix|preface|reference"
- mode="xep.outline"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-
-</xsl:template>
-
-<xsl:template match="preface|chapter|appendix"
- mode="xep.outline">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
- <xsl:variable name="bookmark-label">
- <xsl:apply-templates select="." mode="label.markup"/>
- <xsl:apply-templates select="." mode="title.markup"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="parent::*">
- <rx:bookmark internal-destination="{$id}">
- <rx:bookmark-label>
- <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
- </rx:bookmark-label>
- <xsl:if test="section|sect1">
- <xsl:apply-templates select="section|sect1"
- mode="xep.outline"/>
- </xsl:if>
- </rx:bookmark>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="section|sect1">
- <xsl:apply-templates select="section|sect1"
- mode="xep.outline"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="section|sect1|sect2|sect3|sect4|sect5"
- mode="xep.outline">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
- <xsl:variable name="bookmark-label">
- <xsl:apply-templates select="." mode="label.markup"/>
- <xsl:apply-templates select="." mode="title.markup"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="parent::*">
- <rx:bookmark internal-destination="{$id}">
- <rx:bookmark-label>
- <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
- </rx:bookmark-label>
- <xsl:if test="section|sect2|sect3|sect4|sect5">
- <xsl:apply-templates select="section|sect2|sect3|sect4|sect5"
- mode="xep.outline"/>
- </xsl:if>
- </rx:bookmark>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="section|sect2|sect3|sect4|sect5">
- <xsl:apply-templates select="section|sect2|sect3|sect4|sect5"
- mode="xep.outline"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="bibliography|glossary|index"
- mode="xep.outline">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
- <xsl:variable name="bookmark-label">
- <xsl:apply-templates select="." mode="label.markup"/>
- <xsl:apply-templates select="." mode="title.markup"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="parent::*">
- <rx:bookmark internal-destination="{$id}">
- <rx:bookmark-label>
- <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
- </rx:bookmark-label>
- </rx:bookmark>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
- </xsl:otherwise>
- </xsl:choose>
+<xsl:template match="*" mode="xep.outline">
+ <xsl:apply-templates select="*" mode="xep.outline"/>
</xsl:template>
-<xsl:template match="article"
+<xsl:template match="set|book|part|reference|preface|chapter|appendix|article
+ |glossary|bibliography|index
+ |refentry
+ |sect1|sect2|sect3|sect4|sect5|section"
mode="xep.outline">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
<rx:bookmark-label>
<xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
</rx:bookmark-label>
- <xsl:if test="section|sect1|appendix|bibliography|glossary|index">
- <xsl:apply-templates select="section|sect1|appendix|bibliography|glossary|index"
- mode="xep.outline"/>
- </xsl:if>
+ <xsl:apply-templates select="*" mode="xep.outline"/>
</rx:bookmark>
</xsl:when>
<xsl:otherwise>
- <xsl:if test="section|sect1|appendix|bibliography|glossary|index">
- <xsl:apply-templates select="section|sect1|appendix|bibliography|glossary|index"
- mode="xep.outline"/>
- </xsl:if>
+ <xsl:apply-templates select="*" mode="xep.outline"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-<xsl:template match="title" mode="xep.outline">
- <xsl:apply-templates/>
-</xsl:template>
-
</xsl:stylesheet>