Imported Upstream version 1.77.1
[platform/upstream/docbook-xsl.git] / common / subtitles.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
4                 exclude-result-prefixes="doc"
5                 version='1.0'>
6
7 <!-- ********************************************************************
8      $Id: subtitles.xsl 9286 2012-04-19 10:10:58Z bobstayton $
9      ********************************************************************
10
11      This file is part of the XSL DocBook Stylesheet distribution.
12      See ../README or http://docbook.sf.net/release/xsl/current/ for
13      copyright and other information.
14
15      ******************************************************************** -->
16
17 <!-- ==================================================================== -->
18
19 <!-- subtitle markup -->
20
21 <doc:mode mode="subtitle.markup" xmlns="">
22 <refpurpose>Provides access to element subtitles</refpurpose>
23 <refdescription id="subtitle.markup-desc">
24 <para>Processing an element in the
25 <literal role="mode">subtitle.markup</literal> mode produces the
26 subtitle of the element.
27 </para>
28 </refdescription>
29 </doc:mode>
30
31 <xsl:template match="*" mode="subtitle.markup">
32   <xsl:param name="verbose" select="1"/>
33   <xsl:if test="$verbose != 0">
34     <xsl:message>
35       <xsl:text>Request for subtitle of unexpected element: </xsl:text>
36       <xsl:value-of select="local-name(.)"/>
37     </xsl:message>
38     <xsl:text>???SUBTITLE???</xsl:text>
39   </xsl:if>
40 </xsl:template>
41
42 <xsl:template match="subtitle" mode="subtitle.markup">
43   <xsl:param name="allow-anchors" select="'0'"/>
44   <xsl:param name="verbose" select="1"/>
45   <xsl:apply-templates/>
46 </xsl:template>
47
48 <xsl:template match="set" mode="subtitle.markup">
49   <xsl:param name="allow-anchors" select="'0'"/>
50   <xsl:param name="verbose" select="1"/>
51   <xsl:apply-templates select="(setinfo/subtitle|info/subtitle|subtitle)[1]"
52                        mode="subtitle.markup">
53     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
54     <xsl:with-param name="verbose" select="$verbose"/>
55   </xsl:apply-templates>
56 </xsl:template>
57
58 <xsl:template match="book" mode="subtitle.markup">
59   <xsl:param name="allow-anchors" select="'0'"/>
60   <xsl:param name="verbose" select="1"/>
61   <xsl:apply-templates select="(bookinfo/subtitle|info/subtitle|subtitle)[1]"
62                        mode="subtitle.markup">
63     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
64     <xsl:with-param name="verbose" select="$verbose"/>
65   </xsl:apply-templates>
66 </xsl:template>
67
68 <xsl:template match="part" mode="subtitle.markup">
69   <xsl:param name="allow-anchors" select="'0'"/>
70   <xsl:param name="verbose" select="1"/>
71   <xsl:apply-templates select="(partinfo/subtitle
72                                 |docinfo/subtitle
73                                 |info/subtitle
74                                 |subtitle)[1]"
75                        mode="subtitle.markup">
76     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
77     <xsl:with-param name="verbose" select="$verbose"/>
78   </xsl:apply-templates>
79 </xsl:template>
80
81 <xsl:template match="preface|chapter|appendix" mode="subtitle.markup">
82   <xsl:param name="allow-anchors" select="'0'"/>
83   <xsl:param name="verbose" select="1"/>
84   <xsl:apply-templates select="(docinfo/subtitle
85                                 |info/subtitle
86                                 |prefaceinfo/subtitle
87                                 |chapterinfo/subtitle
88                                 |appendixinfo/subtitle
89                                 |subtitle)[1]"
90                        mode="subtitle.markup">
91     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
92     <xsl:with-param name="verbose" select="$verbose"/>
93   </xsl:apply-templates>
94 </xsl:template>
95
96 <xsl:template match="article" mode="subtitle.markup">
97   <xsl:param name="allow-anchors" select="'0'"/>
98   <xsl:param name="verbose" select="1"/>
99   <xsl:apply-templates select="(artheader/subtitle
100                                 |articleinfo/subtitle
101                                 |info/subtitle
102                                 |subtitle)[1]"
103                        mode="subtitle.markup">
104     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
105     <xsl:with-param name="verbose" select="$verbose"/>
106   </xsl:apply-templates>
107 </xsl:template>
108
109 <xsl:template match="dedication|colophon" mode="subtitle.markup">
110   <xsl:param name="allow-anchors" select="'0'"/>
111   <xsl:param name="verbose" select="1"/>
112   <xsl:apply-templates select="(subtitle|info/subtitle)[1]"
113                        mode="subtitle.markup">
114     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
115     <xsl:with-param name="verbose" select="$verbose"/>
116   </xsl:apply-templates>
117 </xsl:template>
118
119 <xsl:template match="reference" mode="subtitle.markup">
120   <xsl:param name="allow-anchors" select="'0'"/>
121   <xsl:param name="verbose" select="1"/>
122   <xsl:apply-templates select="(referenceinfo/subtitle
123                                 |docinfo/subtitle
124                                 |info/subtitle
125                                 |subtitle)[1]"
126                        mode="subtitle.markup">
127     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
128     <xsl:with-param name="verbose" select="$verbose"/>
129   </xsl:apply-templates>
130 </xsl:template>
131
132 <xsl:template match="qandaset" mode="subtitle.markup">
133   <xsl:param name="allow-anchors" select="'0'"/>
134   <xsl:param name="verbose" select="1"/>
135   <xsl:apply-templates select="(blockinfo/subtitle|info/subtitle)[1]"
136                        mode="subtitle.markup">
137     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
138     <xsl:with-param name="verbose" select="$verbose"/>
139   </xsl:apply-templates>
140 </xsl:template>
141
142 <xsl:template match="refentry" mode="subtitle.markup">
143   <xsl:param name="allow-anchors" select="'0'"/>
144   <xsl:param name="verbose" select="1"/>
145   <xsl:apply-templates select="(refentryinfo/subtitle
146                                 |info/subtitle
147                                 |docinfo/subtitle)[1]"
148                        mode="subtitle.markup">
149     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
150     <xsl:with-param name="verbose" select="$verbose"/>
151   </xsl:apply-templates>
152 </xsl:template>
153
154 <xsl:template match="section
155                      |sect1|sect2|sect3|sect4|sect5
156                      |refsect1|refsect2|refsect3
157                      |topic
158                      |simplesect"
159               mode="subtitle.markup">
160   <xsl:param name="allow-anchors" select="'0'"/>
161   <xsl:param name="verbose" select="1"/>
162   <xsl:apply-templates select="(info/subtitle
163                                 |sectioninfo/subtitle
164                                 |sect1info/subtitle
165                                 |sect2info/subtitle
166                                 |sect3info/subtitle
167                                 |sect4info/subtitle
168                                 |sect5info/subtitle
169                                 |refsect1info/subtitle
170                                 |refsect2info/subtitle
171                                 |refsect3info/subtitle
172                                 |subtitle)[1]"
173                        mode="subtitle.markup">
174     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
175     <xsl:with-param name="verbose" select="$verbose"/>
176   </xsl:apply-templates>
177 </xsl:template>
178
179 </xsl:stylesheet>
180