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