| 1 |
<html> |
| 2 |
<head> |
| 3 |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| 4 |
|
| 5 |
<title>Common Template Reference</title> |
| 6 |
<link rel="stylesheet" href="../reference.css" type="text/css"> |
| 7 |
<meta name="generator" content="DocBook XSL Stylesheets V1.38"> |
| 8 |
</head> |
| 9 |
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| 10 |
<div class="reference"> |
| 11 |
<div class="titlepage"> |
| 12 |
<div> |
| 13 |
<h1 class="title"><a name="d41e1"></a>Common Template Reference |
| 14 |
</h1> |
| 15 |
</div> |
| 16 |
<div> |
| 17 |
<h3 class="author">Norman Walsh</h3> |
| 18 |
</div> |
| 19 |
<div> |
| 20 |
<p class="releaseinfo"> |
| 21 |
$Id$ |
| 22 |
|
| 23 |
</p> |
| 24 |
</div> |
| 25 |
<div> |
| 26 |
<p class="copyright"><a href="../copyright.html">Copyright</a> © 1999, 2000 by Norman Walsh. <a href="../warranty.html">No Warranty</a>. |
| 27 |
</p> |
| 28 |
</div> |
| 29 |
<hr> |
| 30 |
</div> |
| 31 |
<div class="partintro"> |
| 32 |
<div></div> |
| 33 |
<div class="section"><a name="d41e24"></a><div class="titlepage"> |
| 34 |
<div> |
| 35 |
<h2 class="title" style="clear: all"><a name="d41e24"></a>Introduction |
| 36 |
</h2> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
<p>This is technical reference documentation for the DocBook XSL |
| 40 |
Stylesheets; it documents (some of) the parameters, templates, and |
| 41 |
other elements of the stylesheets. |
| 42 |
</p> |
| 43 |
<p>This is not intended to be “user” documentation. |
| 44 |
It is provided for developers writing customization layers for the |
| 45 |
stylesheets, and for anyone who's interested in “how it |
| 46 |
works”. |
| 47 |
</p> |
| 48 |
<p>Although I am trying to be thorough, this documentation is known |
| 49 |
to be incomplete. Don't forget to read the source, too :-) |
| 50 |
</p> |
| 51 |
</div> |
| 52 |
<div class="toc"> |
| 53 |
<p><b>Table of Contents</b></p> |
| 54 |
<dl> |
| 55 |
<dt><a href="#template.is.component">is.component</a></dt> |
| 56 |
<dt><a href="#template.is.section">is.section</a></dt> |
| 57 |
<dt><a href="#template.section.level">section.level</a></dt> |
| 58 |
<dt><a href="#template.qanda.section.level">qanda.section.level</a></dt> |
| 59 |
<dt><a href="#template.select.mediaobject">select.mediaobject</a></dt> |
| 60 |
<dt><a href="#template.is.acceptable.mediaobject">is.acceptable.mediaobject</a></dt> |
| 61 |
<dt><a href="#template.check.id.unique">check.id.unique</a></dt> |
| 62 |
<dt><a href="#template.check.idref.targets">check.idref.targets</a></dt> |
| 63 |
</dl> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
<hr> |
| 67 |
<div class="refentry"> |
| 68 |
<h1 class="title"><a name="template.is.component"></a>is.component |
| 69 |
</h1> |
| 70 |
<div class="refnamediv"><a name="d41e40"></a><h2>Name</h2>is.component — Tests if a given node is a component-level element |
| 71 |
</div> |
| 72 |
<div class="refsynopsisdiv"><a name="d41e45"></a><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="is.component"> |
| 73 |
<xsl:param name="node" select="."/> |
| 74 |
... |
| 75 |
</xsl:template></pre></div> |
| 76 |
<div class="refdescription"><a name="d41e48"></a> |
| 77 |
|
| 78 |
|
| 79 |
<p>This template returns '1' if the specified node is a component |
| 80 |
(Chapter, Appendix, etc.), and '0' otherwise. |
| 81 |
</p> |
| 82 |
|
| 83 |
|
| 84 |
</div> |
| 85 |
<div class="refparameter"><b><a name="d41e53"></a>Parameters</b> |
| 86 |
|
| 87 |
|
| 88 |
<div class="variablelist"> |
| 89 |
<dl> |
| 90 |
<dt><a name="d41e56"></a><span class="term">node</span></dt> |
| 91 |
<dd> |
| 92 |
<p><a name="d41e59"></a>The node which is to be tested. |
| 93 |
</p> |
| 94 |
</dd> |
| 95 |
</dl> |
| 96 |
</div> |
| 97 |
|
| 98 |
|
| 99 |
</div> |
| 100 |
<div class="refreturn"><b><a name="d41e63"></a>Returns</b> |
| 101 |
|
| 102 |
|
| 103 |
<p>This template returns '1' if the specified node is a component |
| 104 |
(Chapter, Appendix, etc.), and '0' otherwise. |
| 105 |
</p> |
| 106 |
|
| 107 |
|
| 108 |
</div> |
| 109 |
</div> |
| 110 |
<hr> |
| 111 |
<div class="refentry"> |
| 112 |
<h1 class="title"><a name="template.is.section"></a>is.section |
| 113 |
</h1> |
| 114 |
<div class="refnamediv"><a name="d41e69"></a><h2>Name</h2>is.section — Tests if a given node is a section-level element |
| 115 |
</div> |
| 116 |
<div class="refsynopsisdiv"><a name="d41e74"></a><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="is.section"> |
| 117 |
<xsl:param name="node" select="."/> |
| 118 |
... |
| 119 |
</xsl:template></pre></div> |
| 120 |
<div class="refdescription"><a name="d41e77"></a> |
| 121 |
|
| 122 |
|
| 123 |
<p>This template returns '1' if the specified node is a section |
| 124 |
(Section, Sect1, Sect2, etc.), and '0' otherwise. |
| 125 |
</p> |
| 126 |
|
| 127 |
|
| 128 |
</div> |
| 129 |
<div class="refparameter"><b><a name="d41e82"></a>Parameters</b> |
| 130 |
|
| 131 |
|
| 132 |
<div class="variablelist"> |
| 133 |
<dl> |
| 134 |
<dt><a name="d41e85"></a><span class="term">node</span></dt> |
| 135 |
<dd> |
| 136 |
<p><a name="d41e88"></a>The node which is to be tested. |
| 137 |
</p> |
| 138 |
</dd> |
| 139 |
</dl> |
| 140 |
</div> |
| 141 |
|
| 142 |
|
| 143 |
</div> |
| 144 |
<div class="refreturn"><b><a name="d41e92"></a>Returns</b> |
| 145 |
|
| 146 |
|
| 147 |
<p>This template returns '1' if the specified node is a section |
| 148 |
(Section, Sect1, Sect2, etc.), and '0' otherwise. |
| 149 |
</p> |
| 150 |
|
| 151 |
|
| 152 |
</div> |
| 153 |
</div> |
| 154 |
<hr> |
| 155 |
<div class="refentry"> |
| 156 |
<h1 class="title"><a name="template.section.level"></a>section.level |
| 157 |
</h1> |
| 158 |
<div class="refnamediv"><a name="d41e98"></a><h2>Name</h2>section.level — Returns the hierarchical level of a section. |
| 159 |
</div> |
| 160 |
<div class="refsynopsisdiv"><a name="d41e103"></a><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="section.level"> |
| 161 |
<xsl:param name="node" select="."/> |
| 162 |
... |
| 163 |
</xsl:template></pre></div> |
| 164 |
<div class="refdescription"><a name="d41e106"></a> |
| 165 |
|
| 166 |
|
| 167 |
<p>This template calculates the hierarchical level of a section. |
| 168 |
Hierarchically, components are “top level”, so a |
| 169 |
<tt>sect1</tt> is at level 2, <tt>sect3</tt> is |
| 170 |
at level 3, etc. |
| 171 |
</p> |
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
<p>Recursive sections are calculated down to the sixth level.</p> |
| 177 |
|
| 178 |
|
| 179 |
</div> |
| 180 |
<div class="refparameter"><b><a name="d41e123"></a>Parameters</b> |
| 181 |
|
| 182 |
|
| 183 |
<div class="variablelist"> |
| 184 |
<dl> |
| 185 |
<dt><a name="d41e126"></a><span class="term">node</span></dt> |
| 186 |
<dd> |
| 187 |
<p><a name="d41e129"></a>The section node for which the level should be calculated. |
| 188 |
Defaults to the context node. |
| 189 |
</p> |
| 190 |
</dd> |
| 191 |
</dl> |
| 192 |
</div> |
| 193 |
|
| 194 |
|
| 195 |
</div> |
| 196 |
<div class="refreturn"><b><a name="d41e133"></a>Returns</b> |
| 197 |
|
| 198 |
|
| 199 |
<p>The section level, “2”, “3”, etc. |
| 200 |
|
| 201 |
</p> |
| 202 |
|
| 203 |
|
| 204 |
</div> |
| 205 |
</div> |
| 206 |
<hr> |
| 207 |
<div class="refentry"> |
| 208 |
<h1 class="title"><a name="template.qanda.section.level"></a>qanda.section.level |
| 209 |
</h1> |
| 210 |
<div class="refnamediv"><a name="d41e145"></a><h2>Name</h2>qanda.section.level — Returns the hierarchical level of a QandASet. |
| 211 |
</div> |
| 212 |
<div class="refsynopsisdiv"><a name="d41e150"></a><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="qanda.section.level"/></pre></div> |
| 213 |
<div class="refdescription"><a name="d41e153"></a> |
| 214 |
|
| 215 |
|
| 216 |
<p>This template calculates the hierarchical level of a QandASet. |
| 217 |
|
| 218 |
</p> |
| 219 |
|
| 220 |
|
| 221 |
</div> |
| 222 |
<div class="refreturn"><b><a name="d41e158"></a>Returns</b> |
| 223 |
|
| 224 |
|
| 225 |
<p>The level, “1”, “2”, etc. |
| 226 |
|
| 227 |
</p> |
| 228 |
|
| 229 |
|
| 230 |
</div> |
| 231 |
</div> |
| 232 |
<hr> |
| 233 |
<div class="refentry"> |
| 234 |
<h1 class="title"><a name="template.select.mediaobject"></a>select.mediaobject |
| 235 |
</h1> |
| 236 |
<div class="refnamediv"><a name="d41e170"></a><h2>Name</h2>select.mediaobject — Selects an appropriate media object from a list |
| 237 |
</div> |
| 238 |
<div class="refsynopsisdiv"><a name="d41e175"></a><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="select.mediaobject"> |
| 239 |
<xsl:param name="olist" select="imageobject|imageobjectco |videoobject|audioobject|textobject"/> |
| 240 |
<xsl:param name="count">1</xsl:param> |
| 241 |
... |
| 242 |
</xsl:template></pre></div> |
| 243 |
<div class="refdescription"><a name="d41e178"></a> |
| 244 |
|
| 245 |
|
| 246 |
<p>This template examines a list of media objects (usually the |
| 247 |
children of a mediaobject or inlinemediaobject) and processes |
| 248 |
the "right" object. |
| 249 |
</p> |
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
<p>This template relies on a template named "is.acceptable.mediaobject" |
| 255 |
to determine if a given object is an acceptable graphic. The semantics |
| 256 |
of media objects is that the first acceptable graphic should be used. |
| 257 |
|
| 258 |
</p> |
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
<p>If no acceptable object is located, nothing happens.</p> |
| 264 |
|
| 265 |
|
| 266 |
</div> |
| 267 |
<div class="refparameter"><b><a name="d41e189"></a>Parameters</b> |
| 268 |
|
| 269 |
|
| 270 |
<div class="variablelist"> |
| 271 |
<dl> |
| 272 |
<dt><a name="d41e192"></a><span class="term">olist</span></dt> |
| 273 |
<dd> |
| 274 |
<p><a name="d41e195"></a>The node list of potential objects to examine. |
| 275 |
</p> |
| 276 |
</dd> |
| 277 |
</dl> |
| 278 |
</div> |
| 279 |
|
| 280 |
|
| 281 |
</div> |
| 282 |
<div class="refreturn"><b><a name="d41e199"></a>Returns</b> |
| 283 |
|
| 284 |
|
| 285 |
<p>Calls <xsl:apply-templates> on the selected object.</p> |
| 286 |
|
| 287 |
|
| 288 |
</div> |
| 289 |
</div> |
| 290 |
<hr> |
| 291 |
<div class="refentry"> |
| 292 |
<h1 class="title"><a name="template.is.acceptable.mediaobject"></a>is.acceptable.mediaobject |
| 293 |
</h1> |
| 294 |
<div class="refnamediv"><a name="d41e205"></a><h2>Name</h2>is.acceptable.mediaobject — Returns '1' if the specified media object is recognized. |
| 295 |
</div> |
| 296 |
<div class="refsynopsisdiv"><a name="d41e210"></a><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="is.acceptable.mediaobject"> |
| 297 |
<xsl:param name="object"/> |
| 298 |
... |
| 299 |
</xsl:template></pre></div> |
| 300 |
<div class="refdescription"><a name="d41e213"></a> |
| 301 |
|
| 302 |
|
| 303 |
<p>This template examines a media object and returns '1' if the |
| 304 |
object is recognized as a graphic. |
| 305 |
</p> |
| 306 |
|
| 307 |
|
| 308 |
</div> |
| 309 |
<div class="refparameter"><b><a name="d41e218"></a>Parameters</b> |
| 310 |
|
| 311 |
|
| 312 |
<div class="variablelist"> |
| 313 |
<dl> |
| 314 |
<dt><a name="d41e221"></a><span class="term">object</span></dt> |
| 315 |
<dd> |
| 316 |
<p><a name="d41e224"></a>The media object to consider. |
| 317 |
</p> |
| 318 |
</dd> |
| 319 |
</dl> |
| 320 |
</div> |
| 321 |
|
| 322 |
|
| 323 |
</div> |
| 324 |
<div class="refreturn"><b><a name="d41e228"></a>Returns</b> |
| 325 |
|
| 326 |
|
| 327 |
<p>0 or 1</p> |
| 328 |
|
| 329 |
|
| 330 |
</div> |
| 331 |
</div> |
| 332 |
<hr> |
| 333 |
<div class="refentry"> |
| 334 |
<h1 class="title"><a name="template.check.id.unique"></a>check.id.unique |
| 335 |
</h1> |
| 336 |
<div class="refnamediv"><a name="d41e234"></a><h2>Name</h2>check.id.unique — Warn users about references to non-unique IDs |
| 337 |
</div> |
| 338 |
<div class="refsynopsisdiv"><a name="d41e239"></a><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="check.id.unique"> |
| 339 |
<xsl:param name="linkend"/> |
| 340 |
... |
| 341 |
</xsl:template></pre></div> |
| 342 |
<div class="refdescription"><a name="d41e242"></a> |
| 343 |
|
| 344 |
|
| 345 |
<p>If passed an ID in <tt>linkend</tt>, |
| 346 |
<tt>check.id.unique</tt> prints |
| 347 |
a warning message to the user if either the ID does not exist or |
| 348 |
the ID is not unique. |
| 349 |
</p> |
| 350 |
|
| 351 |
|
| 352 |
</div> |
| 353 |
</div> |
| 354 |
<hr> |
| 355 |
<div class="refentry"> |
| 356 |
<h1 class="title"><a name="template.check.idref.targets"></a>check.idref.targets |
| 357 |
</h1> |
| 358 |
<div class="refnamediv"><a name="d41e254"></a><h2>Name</h2>check.idref.targets — Warn users about incorrectly typed references |
| 359 |
</div> |
| 360 |
<div class="refsynopsisdiv"><a name="d41e259"></a><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="check.idref.targets"> |
| 361 |
<xsl:param name="linkend"/> |
| 362 |
<xsl:param name="element-list"/> |
| 363 |
... |
| 364 |
</xsl:template></pre></div> |
| 365 |
<div class="refdescription"><a name="d41e262"></a> |
| 366 |
|
| 367 |
|
| 368 |
<p>If passed an ID in <tt>linkend</tt>, |
| 369 |
<tt>check.idref.targets</tt> makes sure that the element |
| 370 |
pointed to by the link is one of the elements listed in |
| 371 |
<tt>element-list</tt> and warns the user otherwise. |
| 372 |
</p> |
| 373 |
|
| 374 |
|
| 375 |
</div> |
| 376 |
</div> |
| 377 |
</div> |
| 378 |
</body> |
| 379 |
</html> |