/usr/share/yelp-xsl/xslt/docbook/common/db-title.xsl is in yelp-xsl 3.10.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<!--
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:msg="http://projects.gnome.org/yelp/gettext/"
exclude-result-prefixes="db msg"
version="1.0">
<!--!!==========================================================================
DocBook Titles
Support for DocBook title, titleabbrev, and subtitle elements.
:Revision:version="3.4" date="2011-11-10" status="final"
This stylesheet contains templates for outputting titles based on title,
titleabbrev, or subtitle elements. It supports automatic titles for certain
elements with optional titles.
-->
<!--**==========================================================================
db.title
Output a title for an element.
:Revision:version="3.4" date="2011-11-10" status="final"
$node: The element to output the title of.
$info: The info child element of ${node}.
This template outputs the title of the element ${node} as it might be used for
a heading or for link text. For certain types of elements, this templates will
use a localized automatic title if no explicit title is provided.
-->
<xsl:template name="db.title">
<xsl:param name="node" select="."/>
<xsl:param name="info" select="
$node/appendixinfo | $node/articleinfo | $node/bibliographyinfo | $node/blockinfo |
$node/bookinfo | $node/chapterinfo | $node/glossaryinfo | $node/indexinfo |
$node/objectinfo | $node/partinfo | $node/prefaceinfo | $node/refentryinfo |
$node/referenceinfo | $node/refsect1info | $node/refsect2info | $node/refsect3info |
$node/refsectioninfo | $node/refsynopsisdivinfo | $node/sect1info | $node/sect2info |
$node/sect3infof | $node/sect4info | $node/sect5info | $node/sectioninfo |
$node/setindexinfo | $node/db:info "/>
<xsl:choose>
<xsl:when test="$node/self::anchor or $node/self::db:anchor">
<xsl:variable name="target_chunk_id">
<xsl:call-template name="db.chunk.chunk-id">
<xsl:with-param name="node" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="target_chunk" select="key('db.id.key', $target_chunk_id)"/>
<xsl:call-template name="db.title">
<xsl:with-param name="node" select="$target_chunk"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$node/self::refentry/refmeta/refentrytitle or
$node/self::db:refentry/db:refmeta/db:refentrytitle">
<xsl:apply-templates select="($node/refmeta/refentrytitle | $node/db:refmeta/db:refentrytitle)[1]/node()"/>
<xsl:if test="$node/refmeta/manvolnum | $node/db:refmeta/db:manvolnum">
<xsl:text>(</xsl:text>
<xsl:apply-templates select="($node/refmeta/manvolnum | $node/db:refmeta/db:manvolnum)[1]/node()"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:when>
<xsl:when test="$node/title or $node/db:title">
<xsl:apply-templates select="$node/title/node() | $node/db:title/node()"/>
</xsl:when>
<xsl:when test="$info/title or $info/db:title">
<xsl:apply-templates select="$info/title/node() | $info/db:title/node()"/>
</xsl:when>
<xsl:when test="$node/self::bibliography or $node/self::db:bibliography">
<xsl:call-template name="l10n.gettext">
<xsl:with-param name="msgid" select="'Bibliography'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$node/self::colophon or $node/self::db:colophon">
<xsl:call-template name="l10n.gettext">
<xsl:with-param name="msgid" select="'Colophon'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$node/self::dedication or $node/self::db:dedication">
<xsl:call-template name="l10n.gettext">
<xsl:with-param name="msgid" select="'Dedication'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$node/self::glossary or $node/self::db:glossary">
<xsl:call-template name="l10n.gettext">
<xsl:with-param name="msgid" select="'Glossary'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$node/self::glossentry or $node/self::db:glossentry">
<xsl:apply-templates select="$node/glossterm/node() | $node/db:glossterm/node()"/>
</xsl:when>
<xsl:when test="$node/self::index or $node/self::db:index or
$node/self::setindex or $node/self::db:setindex">
<xsl:call-template name="l10n.gettext">
<xsl:with-param name="msgid" select="'Index'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$node/self::qandaentry or $node/self::db:qandaentry">
<xsl:call-template name="db.title">
<xsl:with-param name="node" select="question | db:question"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$node/self::question or $node/self::db:question">
<xsl:apply-templates select="($node//para | $node//db:para)[1]/node()"/>
</xsl:when>
<xsl:when test="$node/self::refentry or $node/self::db:refentry">
<xsl:apply-templates select="($node/refnamediv/refname | $node/db:refnamediv/db:refname)[1]/node()"/>
</xsl:when>
<xsl:when test="$node/self::refsynopsisdiv or $node/self::db:refsynopsisdiv">
<xsl:call-template name="l10n.gettext">
<xsl:with-param name="msgid" select="'Synopsis'"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--**==========================================================================
db.titleabbrev
Output an abbreviated title for an element.
:Revision:version="3.4" date="2011-11-10" status="final"
$node: The element to output the abbreviated title of.
$info: The info child element of ${node}.
This template outputs the abbreviated title of the element ${node}, which is
sometimes used for link text. If no explicit #{titleabbrev} element is found,
this template just calls *{db.title}.
-->
<xsl:template name="db.titleabbrev">
<xsl:param name="node" select="."/>
<xsl:param name="info" select="
$node/appendixinfo | $node/articleinfo | $node/bibliographyinfo | $node/blockinfo |
$node/bookinfo | $node/chapterinfo | $node/glossaryinfo | $node/indexinfo |
$node/objectinfo | $node/partinfo | $node/prefaceinfo | $node/refentryinfo |
$node/referenceinfo | $node/refsect1info | $node/refsect2info | $node/refsect3info |
$node/refsectioninfo | $node/refsynopsisdivinfo | $node/sect1info | $node/sect2info |
$node/sect3infof | $node/sect4info | $node/sect5info | $node/sectioninfo |
$node/setindexinfo | $node/db:info "/>
<xsl:variable name="titleabbrev" select="
$node/titleabbrev | $node/db:titleabbrev | $info/titleabbrev | $info/db:titleabbrev"/>
<xsl:choose>
<xsl:when test="$titleabbrev">
<xsl:apply-templates select="$titleabbrev[1]/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="db.title">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="info" select="$info"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--**==========================================================================
db.subtitle
Output a subtitle for an element.
:Revision:version="3.4" date="2011-11-10" status="final"
$node: The element to output the subtitle of.
$info: The info child element of ${node}.
This template outputs the subtitle of the element ${node}, which is sometimes
used for link text. If no explicit #{titleabbrev} element is found, this template
just calls *{db.title}. This template is not suitable for determining whehter a
subtitle should be placed in a heading, as it will always return the title if
a subtitle is not found.
-->
<xsl:template name="db.subtitle">
<xsl:param name="node" select="."/>
<xsl:param name="info" select="
$node/appendixinfo | $node/articleinfo | $node/bibliographyinfo | $node/blockinfo |
$node/bookinfo | $node/chapterinfo | $node/glossaryinfo | $node/indexinfo |
$node/objectinfo | $node/partinfo | $node/prefaceinfo | $node/refentryinfo |
$node/referenceinfo | $node/refsect1info | $node/refsect2info | $node/refsect3info |
$node/refsectioninfo | $node/refsynopsisdivinfo | $node/sect1info | $node/sect2info |
$node/sect3infof | $node/sect4info | $node/sect5info | $node/sectioninfo |
$node/setindexinfo | $node/db:info "/>
<xsl:variable name="subtitle" select="
$node/subtitle | $node/db:subtitle | $info/subtitle | $info/db:subtitle"/>
<xsl:choose>
<xsl:when test="$subtitle">
<xsl:apply-templates select="$subtitle[1]/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="db.title">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="info" select="$info"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|