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