devhelp: add glossary and index to the toc
[gtk-doc.git] / gtk-doc.xsl
blob0b6b320b8d3720e2dd4f8f0ce6a34723508a9d84
1 <?xml version='1.0'?> <!--*- mode: xml -*-->
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 version="1.0">
5 <!-- import the chunked XSL stylesheet -->
6 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
7 <xsl:include href="devhelp.xsl"/>
8 <xsl:include href="devhelp2.xsl"/>
9 <xsl:include href="version-greater-or-equal.xsl"/>
11 <!-- change some parameters -->
12 <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html -->
13 <xsl:param name="toc.section.depth">2</xsl:param>
14 <xsl:param name="generate.toc">
15 book toc
16 chapter toc
17 glossary toc
18 index toc
19 part toc
20 reference toc
21 </xsl:param>
23 <xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
24 <xsl:param name="chunker.output.indent" select="'yes'"/>
25 <xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
26 <xsl:param name="chunk.fast" select="1"/>
28 <xsl:param name="default.encoding" select="'UTF-8'"/>
29 <xsl:param name="chapter.autolabel" select="0"/>
30 <xsl:param name="use.id.as.filename" select="1"/>
31 <xsl:param name="html.ext" select="'.html'"/>
32 <xsl:param name="refentry.generate.name" select="0"/>
33 <xsl:param name="refentry.generate.title" select="1"/>
35 <!-- use index filtering (if available) -->
36 <xsl:param name="index.on.role" select="1"/>
38 <!-- display variablelists as tables -->
39 <xsl:param name="variablelist.as.table" select="1"/>
41 <!-- new things to consider
42 <xsl:param name="glossterm.auto.link" select="0"></xsl:param>
43 -->
45 <!-- this gets set on the command line ... -->
46 <xsl:param name="gtkdoc.version" select="''"/>
47 <xsl:param name="gtkdoc.bookname" select="''"/>
49 <!-- ========================================================= -->
50 <!-- template to create the index.sgml anchor index -->
52 <xsl:template match="book|article">
53 <xsl:variable name="tooldver">
54 <xsl:call-template name="version-greater-or-equal">
55 <xsl:with-param name="ver1" select="$VERSION" />
56 <xsl:with-param name="ver2">1.36</xsl:with-param>
57 </xsl:call-template>
58 </xsl:variable>
59 <xsl:if test="$tooldver = 0">
60 <xsl:message terminate="yes">
61 FATAL-ERROR: You need the DocBook XSL Stylesheets version 1.36 or higher
62 to build the documentation.
63 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
64 </xsl:message>
65 </xsl:if>
66 <xsl:apply-imports/>
68 <!-- generate the index.sgml href index -->
69 <xsl:call-template name="generate.index"/>
70 <xsl:call-template name="generate.devhelp"/>
71 <xsl:call-template name="generate.devhelp2"/>
72 </xsl:template>
74 <xsl:template name="generate.index">
75 <xsl:call-template name="write.text.chunk">
76 <xsl:with-param name="filename" select="'index.sgml'"/>
77 <xsl:with-param name="content">
78 <xsl:apply-templates select="//releaseinfo/ulink"
79 mode="generate.index.mode"/>
80 <!-- check all anchor and refentry elements -->
81 <xsl:apply-templates select="//anchor|//refentry|//refsect1|//refsect2|//refsynopsisdiv|//varlistentry"
82 mode="generate.index.mode"/>
83 </xsl:with-param>
84 <xsl:with-param name="default.encoding" select="'UTF-8'"/>
85 <xsl:with-param name="chunker.output.indent" select="'no'"/>
86 </xsl:call-template>
87 </xsl:template>
89 <xsl:template match="*" mode="generate.index.mode">
90 <xsl:if test="not(@href) and count(@id) > 0">
91 <xsl:text>&lt;ANCHOR id=&quot;</xsl:text>
92 <xsl:value-of select="@id"/>
93 <xsl:text>&quot; href=&quot;</xsl:text>
94 <xsl:if test="$gtkdoc.bookname">
95 <xsl:value-of select="$gtkdoc.bookname"/>
96 <xsl:text>/</xsl:text>
97 </xsl:if>
98 <xsl:call-template name="href.target"/>
99 <xsl:text>&quot;&gt;&#10;</xsl:text>
100 </xsl:if>
101 </xsl:template>
103 <xsl:template match="//releaseinfo/ulink" mode="generate.index.mode">
104 <xsl:if test="@role='online-location'">
105 <xsl:text>&lt;ONLINE href=&quot;</xsl:text>
106 <xsl:value-of select="@url"/>
107 <xsl:text>&quot;&gt;&#10;</xsl:text>
108 </xsl:if>
109 </xsl:template>
111 <!-- ========================================================= -->
112 <!-- template to output gtkdoclink elements for the unknown targets -->
114 <xsl:template match="link">
115 <xsl:choose>
116 <xsl:when test="id(@linkend)">
117 <xsl:apply-imports/>
118 </xsl:when>
119 <xsl:otherwise>
120 <GTKDOCLINK HREF="{@linkend}">
121 <xsl:apply-templates/>
122 </GTKDOCLINK>
123 </xsl:otherwise>
124 </xsl:choose>
125 </xsl:template>
127 <!-- ========================================================= -->
128 <!-- Below are the visual portions of the stylesheet. They provide
129 the normal gtk-doc output style. -->
131 <xsl:param name="shade.verbatim" select="0"/>
132 <xsl:param name="refentry.separator" select="0"/>
134 <xsl:template match="refsect2">
135 <xsl:if test="preceding-sibling::refsect2">
136 <hr/>
137 </xsl:if>
138 <xsl:apply-imports/>
139 </xsl:template>
141 <xsl:template name="user.head.content">
142 <xsl:if test="$gtkdoc.version">
143 <meta name="generator" content="GTK-Doc V{$gtkdoc.version} (XML mode)"/>
144 </xsl:if>
145 <link rel="stylesheet" href="style.css" type="text/css"/>
147 <!-- copied from the html.head template in the docbook stylesheets
148 we don't want links for all refentrys, thats just too much
150 <xsl:variable name="this" select="."/>
151 <xsl:for-each select="//part
152 |//reference
153 |//preface
154 |//chapter
155 |//article
156 |//appendix[not(parent::article)]|appendix
157 |//glossary[not(parent::article)]|glossary
158 |//index[not(parent::article)]|index">
159 <link rel="{local-name(.)}">
160 <xsl:attribute name="href">
161 <xsl:call-template name="href.target">
162 <xsl:with-param name="context" select="$this"/>
163 <xsl:with-param name="object" select="."/>
164 </xsl:call-template>
165 </xsl:attribute>
166 <xsl:attribute name="title">
167 <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
168 </xsl:attribute>
169 </link>
170 </xsl:for-each>
171 </xsl:template>
173 <xsl:template name="user.footer.content">
174 <div class="footer">
175 <hr />
176 <xsl:choose>
177 <xsl:when test="$gtkdoc.version">
178 Generated by GTK-Doc V<xsl:copy-of select="$gtkdoc.version" />
179 </xsl:when>
180 <xsl:otherwise>
181 Generated by GTK-Doc
182 </xsl:otherwise>
183 </xsl:choose>
184 </div>
185 </xsl:template>
187 <xsl:template match="title" mode="book.titlepage.recto.mode">
188 <table class="navigation" id="top" width="100%"
189 cellpadding="2" cellspacing="0">
190 <tr>
191 <th valign="middle">
192 <p class="{name(.)}">
193 <xsl:value-of select="."/>
194 </p>
195 </th>
196 </tr>
197 </table>
198 </xsl:template>
200 <xsl:template name="header.navigation">
201 <xsl:param name="prev" select="/foo"/>
202 <xsl:param name="next" select="/foo"/>
203 <xsl:variable name="home" select="/*[1]"/>
204 <xsl:variable name="up" select="parent::*"/>
205 <xsl:variable name="refsections" select="./refsect1[@role]"/>
206 <xsl:variable name="glssections" select="./glossdiv/title"/>
207 <xsl:variable name="idxsections" select="./indexdiv/indexdiv/title"/>
208 <xsl:variable name="section_id" select="./@id"/>
209 <xsl:variable name="sect_object_hierarchy" select="./refsect1[@role='object_hierarchy']"/>
210 <xsl:variable name="sect_impl_interfaces" select="./refsect1[@role='impl_interfaces']"/>
211 <xsl:variable name="sect_prerequisites" select="./refsect1[@role='prerequisites']"/>
212 <xsl:variable name="sect_derived_interfaces" select="./refsect1[@role='derived_interfaces']"/>
213 <xsl:variable name="sect_implementations" select="./refsect1[@role='implementations']"/>
214 <xsl:variable name="sect_properties" select="./refsect1[@role='properties']"/>
215 <xsl:variable name="sect_child_properties" select="./refsect1[@role='child_properties']"/>
216 <xsl:variable name="sect_style_properties" select="./refsect1[@role='style_properties']"/>
217 <xsl:variable name="sect_signal_proto" select="./refsect1[@role='signal_proto']"/>
218 <xsl:variable name="sect_desc" select="./refsect1[@role='desc']"/>
219 <xsl:variable name="sect_synopsis" select="./refsynopsisdiv[@role='synopsis']"/>
220 <!--
221 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
222 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
223 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
224 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
225 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
228 <xsl:if test="$suppress.navigation = '0' and $home != .">
229 <table class="navigation" id="top" width="100%"
230 summary = "Navigation header" cellpadding="2" cellspacing="2">
231 <tr valign="middle">
232 <xsl:choose>
233 <xsl:when test="count($prev) > 0">
234 <td>
235 <a accesskey="p">
236 <xsl:attribute name="href">
237 <xsl:call-template name="href.target">
238 <xsl:with-param name="object" select="$prev"/>
239 </xsl:call-template>
240 </xsl:attribute>
241 <img src="left.png" width="24" height="24" border="0">
242 <xsl:attribute name="alt">
243 <xsl:call-template name="gentext">
244 <xsl:with-param name="key">nav-prev</xsl:with-param>
245 </xsl:call-template>
246 </xsl:attribute>
247 </img>
248 </a>
249 </td>
250 </xsl:when>
251 <xsl:otherwise>
252 <td>&#160;</td>
253 </xsl:otherwise>
254 </xsl:choose>
255 <xsl:choose>
256 <xsl:when test="count($up) > 0 and $up != $home">
257 <td>
258 <a accesskey="u">
259 <xsl:attribute name="href">
260 <xsl:call-template name="href.target">
261 <xsl:with-param name="object" select="$up"/>
262 </xsl:call-template>
263 </xsl:attribute>
264 <img src="up.png" width="24" height="24" border="0">
265 <xsl:attribute name="alt">
266 <xsl:call-template name="gentext">
267 <xsl:with-param name="key">nav-up</xsl:with-param>
268 </xsl:call-template>
269 </xsl:attribute>
270 </img>
271 </a>
272 </td>
273 </xsl:when>
274 <xsl:otherwise>
275 <td>&#160;</td>
276 </xsl:otherwise>
277 </xsl:choose>
278 <xsl:choose>
279 <xsl:when test="$home != .">
280 <td>
281 <a accesskey="h">
282 <xsl:attribute name="href">
283 <xsl:call-template name="href.target">
284 <xsl:with-param name="object" select="$home"/>
285 </xsl:call-template>
286 </xsl:attribute>
287 <img src="home.png" width="24" height="24" border="0">
288 <xsl:attribute name="alt">
289 <xsl:call-template name="gentext">
290 <xsl:with-param name="key">nav-home</xsl:with-param>
291 </xsl:call-template>
292 </xsl:attribute>
293 </img>
294 </a>
295 </td>
296 </xsl:when>
297 <xsl:otherwise>
298 <td>&#160;</td>
299 </xsl:otherwise>
300 </xsl:choose>
301 <th width="100%" align="center">
302 <xsl:apply-templates select="$home" mode="object.title.markup"/>
303 </th>
304 <xsl:choose>
305 <xsl:when test="count($next) > 0">
306 <td>
307 <a accesskey="n">
308 <xsl:attribute name="href">
309 <xsl:call-template name="href.target">
310 <xsl:with-param name="object" select="$next"/>
311 </xsl:call-template>
312 </xsl:attribute>
313 <img src="right.png" width="24" height="24" border="0">
314 <xsl:attribute name="alt">
315 <xsl:call-template name="gentext">
316 <xsl:with-param name="key">nav-next</xsl:with-param>
317 </xsl:call-template>
318 </xsl:attribute>
319 </img>
320 </a>
321 </td>
322 </xsl:when>
323 <xsl:otherwise>
324 <td>&#160;</td>
325 </xsl:otherwise>
326 </xsl:choose>
327 </tr>
328 <!--<xsl:if test="name()='refentry'"-->
329 <xsl:choose>
330 <xsl:when test="count($refsections) > 0">
331 <tr>
332 <td colspan="5" class="shortcuts">
333 <xsl:if test="count($sect_synopsis) > 0">
334 <a href="#{$section_id}.synopsis" class="shortcut">Top</a>
335 </xsl:if>
336 <xsl:if test="count($sect_desc) > 0">
337 &#160;|&#160;
338 <a href="#{$section_id}.description" class="shortcut">
339 <xsl:value-of select="./refsect1[@role='desc']/title"/>
340 </a>
341 </xsl:if>
342 <xsl:if test="count($sect_object_hierarchy) > 0">
343 &#160;|&#160;
344 <a href="#{$section_id}.object-hierarchy" class="shortcut">
345 <xsl:value-of select="./refsect1[@role='object_hierarchy']/title"/>
346 </a>
347 </xsl:if>
348 <xsl:if test="count($sect_impl_interfaces) > 0">
349 &#160;|&#160;
350 <a href="#{$section_id}.implemented-interfaces" class="shortcut">
351 <xsl:value-of select="./refsect1[@role='impl_interfaces']/title"/>
352 </a>
353 </xsl:if>
354 <xsl:if test="count($sect_prerequisites) > 0">
355 &#160;|&#160;
356 <a href="#{$section_id}.prerequisites" class="shortcut">
357 <xsl:value-of select="./refsect1[@role='prerequisites']/title"/>
358 </a>
359 </xsl:if>
360 <xsl:if test="count($sect_derived_interfaces) > 0">
361 &#160;|&#160;
362 <a href="#{$section_id}.derived-interfaces" class="shortcut">
363 <xsl:value-of select="./refsect1[@role='derived_interfaces']/title"/>
364 </a>
365 </xsl:if>
366 <xsl:if test="count($sect_implementations) > 0">
367 &#160;|&#160;
368 <a href="#{$section_id}.implementations" class="shortcut">
369 <xsl:value-of select="./refsect1[@role='implementations']/title"/>
370 </a>
371 </xsl:if>
372 <xsl:if test="count($sect_properties) > 0">
373 &#160;|&#160;
374 <a href="#{$section_id}.properties" class="shortcut">
375 <xsl:value-of select="./refsect1[@role='properties']/title"/>
376 </a>
377 </xsl:if>
378 <xsl:if test="count($sect_child_properties) > 0">
379 &#160;|&#160;
380 <a href="#{$section_id}.child-properties" class="shortcut">
381 <xsl:value-of select="./refsect1[@role='child_properties']/title"/>
382 </a>
383 </xsl:if>
384 <xsl:if test="count($sect_style_properties) > 0">
385 &#160;|&#160;
386 <a href="#{$section_id}.style-properties" class="shortcut">
387 <xsl:value-of select="./refsect1[@role='style_properties']/title"/>
388 </a>
389 </xsl:if>
390 <xsl:if test="count($sect_signal_proto) > 0">
391 &#160;|&#160;
392 <a href="#{$section_id}.signals" class="shortcut">
393 <xsl:value-of select="./refsect1[@role='signal_proto']/title"/>
394 </a>
395 </xsl:if>
396 <!--
397 <xsl:if test="count($sect_details) > 0">
398 <a href="#details" class="shortcut">
399 <xsl:value-of select="./refsect1[@id='details']/title"/>
400 </a>
401 &#160;|&#160;
402 </xsl:if>
403 <xsl:if test="count($sect_property_details) > 0">
404 <a href="#property_details" class="shortcut">
405 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
406 </a>
407 &#160;|&#160;
408 </xsl:if>
409 <xsl:if test="count($sect_child_property_details) > 0">
410 <a href="#child_property_details" class="shortcut">
411 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
412 </a>
413 &#160;|&#160;
414 </xsl:if>
415 <xsl:if test="count($sect_style_property_details) > 0">
416 <a href="#style_property_details" class="shortcut">
417 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
418 </a>
419 &#160;|&#160;
420 </xsl:if>
421 <xsl:if test="count($sect_signals) > 0">
422 <a href="#signals" class="shortcut">
423 <xsl:value-of select="./refsect1[@id='signals']/title"/>
424 </a>
425 &#160;|&#160;
426 </xsl:if>
428 </td>
429 </tr>
430 </xsl:when>
431 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
432 elements having a anchor element. maybe we can customize the xsl
433 to automaticaly create local anchors
435 <xsl:when test="count($glssections) > 0">
436 <tr>
437 <td colspan="5" class="shortcuts">
438 <xsl:for-each select="./glossdiv">
439 <xsl:if test="position() > 1">
440 &#160;|&#160;
441 </xsl:if>
442 <a class="shortcut">
443 <xsl:attribute name="href">#gls<xsl:value-of select="./title"/></xsl:attribute>
444 <xsl:value-of select="./title"/>
445 </a>
446 </xsl:for-each>
447 </td>
448 </tr>
449 </xsl:when>
450 <xsl:when test="count($idxsections) > 0">
451 <tr>
452 <td colspan="5" class="shortcuts">
453 <xsl:for-each select="./indexdiv/indexdiv">
454 <xsl:if test="position() > 1">
455 &#160;|&#160;
456 </xsl:if>
457 <a class="shortcut">
458 <xsl:attribute name="href">#idx<xsl:value-of select="./title"/></xsl:attribute>
459 <xsl:value-of select="./title"/>
460 </a>
461 </xsl:for-each>
462 </td>
463 </tr>
464 </xsl:when>
465 </xsl:choose>
466 </table>
467 </xsl:if>
468 </xsl:template>
470 <xsl:template name="footer.navigation">
471 </xsl:template>
473 <!-- avoid creating multiple identical indices
474 if the stylesheets don't support filtered indices
476 <xsl:template match="index">
477 <xsl:variable name="has-filtered-index">
478 <xsl:call-template name="version-greater-or-equal">
479 <xsl:with-param name="ver1" select="$VERSION" />
480 <xsl:with-param name="ver2">1.66</xsl:with-param>
481 </xsl:call-template>
482 </xsl:variable>
483 <xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
484 <xsl:apply-imports/>
485 </xsl:if>
486 </xsl:template>
488 <xsl:template match="index" mode="toc">
489 <xsl:variable name="has-filtered-index">
490 <xsl:call-template name="version-greater-or-equal">
491 <xsl:with-param name="ver1" select="$VERSION" />
492 <xsl:with-param name="ver2">1.66</xsl:with-param>
493 </xsl:call-template>
494 </xsl:variable>
495 <xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
496 <xsl:apply-imports/>
497 </xsl:if>
498 </xsl:template>
500 <xsl:template match="para">
501 <xsl:choose>
502 <xsl:when test="@role = 'gallery'">
503 <div class="container">
504 <div class="gallery-spacer"> </div>
505 <xsl:apply-templates mode="gallery.mode"/>
506 <div class="gallery-spacer"> </div>
507 </div>
508 </xsl:when>
509 <xsl:otherwise>
510 <xsl:apply-imports/>
511 </xsl:otherwise>
512 </xsl:choose>
513 </xsl:template>
515 <xsl:template match="link" mode="gallery.mode">
516 <div class="gallery-float">
517 <xsl:apply-templates select="."/>
518 </div>
519 </xsl:template>
521 <!-- add gallery handling to refnamediv template -->
522 <xsl:template match="refnamediv">
523 <div class="{name(.)}">
524 <table width="100%">
525 <tr><td valign="top">
526 <xsl:call-template name="anchor"/>
527 <xsl:choose>
528 <xsl:when test="$refentry.generate.name != 0">
529 <h2>
530 <xsl:call-template name="gentext">
531 <xsl:with-param name="key" select="'RefName'"/>
532 </xsl:call-template>
533 </h2>
534 </xsl:when>
535 <xsl:when test="$refentry.generate.title != 0">
536 <h2>
537 <xsl:choose>
538 <xsl:when test="../refmeta/refentrytitle">
539 <xsl:apply-templates select="../refmeta/refentrytitle"/>
540 </xsl:when>
541 <xsl:otherwise>
542 <xsl:apply-templates select="refname[1]"/>
543 </xsl:otherwise>
544 </xsl:choose>
545 </h2>
546 </xsl:when>
547 </xsl:choose>
549 <xsl:apply-templates/>
550 </p>
551 </td>
552 <td valign="top" align="right">
553 <!-- find the gallery image to use here
554 - determine the id of the enclosing refentry
555 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
556 - use it here
558 <xsl:variable name="refentryid" select="../@id"/>
559 <xsl:apply-templates select="//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
560 </td></tr>
561 </table>
562 </div>
563 </xsl:template>
565 <!-- add anchors for index sections -->
566 <xsl:template match="indexdiv">
567 <a><xsl:attribute name="name">idx<xsl:value-of select="./title"/></xsl:attribute></a>
568 <xsl:apply-templates/>
569 </xsl:template>
571 <!-- add anchors for glossary sections -->
572 <xsl:template match="glossdiv">
573 <a><xsl:attribute name="name">gls<xsl:value-of select="./title"/></xsl:attribute></a>
574 <xsl:apply-templates/>
575 </xsl:template>
577 <!-- Exterminate any trace of indexterms in the main flow -->
578 <xsl:template match="indexterm">
579 </xsl:template>
581 <!-- Extra link on the right side of doc-blobs -->
582 <xsl:template name="user.format.extralinks">
583 <xsl:if test="../ulink[@role='extralinks']">
584 <span class="extralinks">
585 <xsl:for-each select="../ulink[@role='extralinks']">
586 <xsl:if test="position() = 1">[&#160;</xsl:if>
587 <xsl:if test="position() > 1">&#160;|&#160;</xsl:if>
589 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
590 <xsl:copy-of select="text()" />
591 </a>
592 <xsl:if test="position() = last()">&#160;]</xsl:if>
593 </xsl:for-each>
594 </span>
595 </xsl:if>
596 <!--xsl:copy-of select="text()" /-->
597 <xsl:apply-templates/>
598 </xsl:template>
600 <xsl:template match="//refsect2/ulink[@role='extralinks']"/>
601 <xsl:template match="//refsect1/ulink[@role='extralinks']"/>
603 <xsl:template match="//refsect2/title">
604 <h3><xsl:call-template name="user.format.extralinks"/></h3>
605 </xsl:template>
607 <xsl:template match="//refsect1/title">
608 <h2><xsl:call-template name="user.format.extralinks"/></h2>
609 </xsl:template>
611 <!-- ==================================================================== -->
613 <xsl:template match="acronym">
614 <xsl:call-template name="generate.acronym.link"/>
615 </xsl:template>
617 <xsl:template name="generate.acronym.link">
618 <xsl:param name="acronym">
619 <xsl:apply-templates/>
620 </xsl:param>
621 <!--
622 We use for-each to change context to the database document because key()
623 only locates elements in the same document as the context node!
626 <xsl:param name="value" >
627 <xsl:value-of select="//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
628 </xsl:param>
629 <xsl:choose>
630 <xsl:when test="$value=''">
631 <!-- debug -->
632 <xsl:message>
633 In gtk-doc.xsl: For acronym (<xsl:value-of select="$acronym"/>) no value found!
634 </xsl:message>
636 <xsl:attribute name="href">
637 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=</xsl:text>
638 <xsl:value-of select="$acronym"/>
639 </xsl:attribute>
640 <xsl:call-template name="inline.charseq"/>
641 </a>
642 </xsl:when>
643 <xsl:otherwise>
644 <!-- found -->
645 <acronym>
646 <xsl:attribute name="title">
647 <xsl:value-of select="$value"/>
648 </xsl:attribute>
649 <xsl:call-template name="inline.charseq"/>
650 </acronym>
651 </xsl:otherwise>
652 </xsl:choose>
653 </xsl:template>
655 </xsl:stylesheet>