Rocco Rutte:
[apps/madmutt.git] / doc / xslt / xhtml / refentry.xsl
1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
5
6 <!-- ********************************************************************
7      $Id$
8      ********************************************************************
9
10      This file is part of the XSL DocBook Stylesheet distribution.
11      See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12      and other information.
13
14      ******************************************************************** -->
15
16 <!-- ==================================================================== -->
17
18 <xsl:template match="reference">
19   <div class="{name(.)}">
20     <xsl:call-template name="language.attribute"/>
21     <xsl:if test="$generate.id.attributes != 0">
22       <xsl:attribute name="id">
23         <xsl:call-template name="object.id"/>
24       </xsl:attribute>
25     </xsl:if>
26
27     <xsl:call-template name="reference.titlepage"/>
28
29     <xsl:variable name="toc.params">
30       <xsl:call-template name="find.path.params">
31         <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
32       </xsl:call-template>
33     </xsl:variable>
34
35     <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
36       <xsl:call-template name="division.toc"/>
37     </xsl:if>
38     <xsl:apply-templates/>
39   </div>
40 </xsl:template>
41
42 <xsl:template match="reference" mode="division.number">
43   <xsl:number from="book" count="reference" format="I."/>
44 </xsl:template>
45
46 <xsl:template match="reference/docinfo"/>
47 <xsl:template match="reference/referenceinfo"/>
48 <xsl:template match="reference/title"/>
49 <xsl:template match="reference/subtitle"/>
50 <xsl:template match="reference/titleabbrev"/>
51
52 <!-- ==================================================================== -->
53
54 <xsl:template name="refentry.title">
55   <xsl:param name="node" select="."/>
56   <xsl:variable name="refmeta" select="$node//refmeta"/>
57   <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
58   <xsl:variable name="refnamediv" select="$node//refnamediv"/>
59   <xsl:variable name="refname" select="$refnamediv//refname"/>
60   <xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
61   <xsl:variable name="title">
62     <xsl:choose>
63       <xsl:when test="$refentrytitle">
64         <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
65       </xsl:when>
66       <xsl:when test="$refdesc">
67         <xsl:apply-templates select="$refdesc[1]" mode="title"/>
68       </xsl:when>
69       <xsl:when test="$refname">
70         <xsl:apply-templates select="$refname[1]" mode="title"/>
71       </xsl:when>
72       <xsl:otherwise/>
73     </xsl:choose>
74   </xsl:variable>
75
76   <h1 class="title">
77     <xsl:copy-of select="$title"/>
78   </h1>
79 </xsl:template>
80
81 <xsl:template match="refentry">
82   <div class="{name(.)}">
83     <xsl:call-template name="language.attribute"/>
84     <xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
85       <div class="refentry.separator">
86         <hr/>
87       </div>
88     </xsl:if>
89     <xsl:call-template name="anchor">
90       <xsl:with-param name="conditional" select="0"/>
91     </xsl:call-template>
92     <xsl:call-template name="refentry.titlepage"/>
93     <xsl:apply-templates/>
94     <xsl:call-template name="process.footnotes"/>
95   </div>
96 </xsl:template>
97
98 <xsl:template match="refentry/docinfo|refentry/refentryinfo"/>
99
100 <xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
101   <xsl:apply-templates/>
102 </xsl:template>
103
104 <xsl:template match="refmeta">
105 </xsl:template>
106
107 <xsl:template match="manvolnum">
108   <xsl:if test="$refentry.xref.manvolnum != 0">
109     <xsl:text>(</xsl:text>
110     <xsl:apply-templates/>
111     <xsl:text>)</xsl:text>
112   </xsl:if>
113 </xsl:template>
114
115 <xsl:template match="refmiscinfo">
116 </xsl:template>
117
118 <xsl:template match="refentrytitle">
119   <xsl:call-template name="inline.charseq"/>
120 </xsl:template>
121
122 <xsl:template match="refnamediv">
123   <div class="{name(.)}">
124     <xsl:call-template name="anchor"/>
125
126     <xsl:choose>
127       <xsl:when test="preceding-sibling::refnamediv">
128         <!-- no title on secondary refnamedivs! -->
129       </xsl:when>
130       <xsl:when test="$refentry.generate.name != 0">
131         <h2>
132           <xsl:call-template name="gentext">
133             <xsl:with-param name="key" select="'RefName'"/>
134           </xsl:call-template>
135         </h2>
136       </xsl:when>
137       <xsl:when test="$refentry.generate.title != 0">
138         <h2>
139           <xsl:choose>
140             <xsl:when test="../refmeta/refentrytitle">
141               <xsl:apply-templates select="../refmeta/refentrytitle"/>
142             </xsl:when>
143             <xsl:otherwise>
144               <xsl:apply-templates select="refname[1]"/>
145             </xsl:otherwise>
146           </xsl:choose>
147         </h2>
148       </xsl:when>
149     </xsl:choose>
150
151     <p>
152       <xsl:apply-templates/>
153     </p>
154   </div>
155 </xsl:template>
156
157 <xsl:template match="refname">
158   <xsl:if test="not(preceding-sibling::refdescriptor)">
159     <xsl:apply-templates/>
160     <xsl:if test="following-sibling::refname">
161       <xsl:text>, </xsl:text>
162     </xsl:if>
163   </xsl:if>
164 </xsl:template>
165
166 <xsl:template match="refpurpose">
167   <xsl:text> </xsl:text>
168   <xsl:call-template name="dingbat">
169     <xsl:with-param name="dingbat">em-dash</xsl:with-param>
170   </xsl:call-template>
171   <xsl:text> </xsl:text>
172   <xsl:apply-templates/>
173 </xsl:template>
174
175 <xsl:template match="refdescriptor">
176   <xsl:apply-templates/>
177 </xsl:template>
178
179 <xsl:template match="refclass">
180   <p>
181     <b>
182       <xsl:if test="@role">
183         <xsl:value-of select="@role"/>
184         <xsl:text>: </xsl:text>
185       </xsl:if>
186       <xsl:apply-templates/>
187     </b>
188   </p>
189 </xsl:template>
190
191 <xsl:template match="refsynopsisdiv">
192   <div class="{name(.)}">
193     <xsl:call-template name="anchor"/>
194     <h2>
195       <xsl:choose>
196         <xsl:when test="refsynopsisdiv/title|title">
197           <xsl:apply-templates select="(refsynopsisdiv/title|title)[1]" mode="titlepage.mode"/>
198         </xsl:when>
199         <xsl:otherwise>
200           <xsl:call-template name="gentext">
201             <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
202           </xsl:call-template>
203         </xsl:otherwise>
204       </xsl:choose>
205     </h2>
206     <xsl:apply-templates/>
207   </div>
208 </xsl:template>
209
210 <xsl:template match="refsynopsisdivinfo"/>
211
212 <xsl:template match="refsynopsisdiv/title">
213 </xsl:template>
214
215 <xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
216   <xsl:apply-templates/>
217 </xsl:template>
218
219 <xsl:template match="refsection|refsect1|refsect2|refsect3">
220   <div class="{name(.)}">
221     <xsl:call-template name="language.attribute"/>
222     <xsl:call-template name="anchor">
223       <xsl:with-param name="conditional" select="0"/>
224     </xsl:call-template>
225     <xsl:apply-templates/>
226   </div>
227 </xsl:template>
228
229 <xsl:template match="refsection/title">
230   <!-- the ID is output in the block.object call for refsect1 -->
231   <xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
232   <xsl:variable name="refsynopsisdiv">
233     <xsl:text>0</xsl:text>
234     <xsl:if test="ancestor::refsynopsisdiv">1</xsl:if>
235   </xsl:variable>
236   <xsl:variable name="hlevel">
237     <xsl:choose>
238       <xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
239       <xsl:otherwise>
240         <xsl:value-of select="$level+1+$refsynopsisdiv"/>
241       </xsl:otherwise>
242     </xsl:choose>
243   </xsl:variable>
244   <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
245     <xsl:apply-templates/>
246   </xsl:element>
247 </xsl:template>
248
249 <xsl:template match="refsect1/title">
250   <!-- the ID is output in the block.object call for refsect1 -->
251   <h2>
252     <xsl:apply-templates/>
253   </h2>
254 </xsl:template>
255
256 <xsl:template match="refsect2/title">
257   <!-- the ID is output in the block.object call for refsect2 -->
258   <h3>
259     <xsl:apply-templates/>
260   </h3>
261 </xsl:template>
262
263 <xsl:template match="refsect3/title">
264   <!-- the ID is output in the block.object call for refsect3 -->
265   <h4>
266     <xsl:apply-templates/>
267   </h4>
268 </xsl:template>
269
270 <xsl:template match="refsect1info"/>
271 <xsl:template match="refsect2info"/>
272 <xsl:template match="refsect3info"/>
273
274 <!-- ==================================================================== -->
275
276 </xsl:stylesheet>