trying to get HEAD building again. If you want the code
[kai/samba-autobuild/.git] / docs / docbook / xslt / db2latex / xref.mod.xsl
1 <?xml version='1.0'?>
2 <!--############################################################################# 
3 |- #############################################################################
4 |                                                                                                               
5 |   PURPOSE: Manage XREFs
6 + ############################################################################## -->
7
8 <xsl:stylesheet 
9     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10     xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
11     exclude-result-prefixes="doc" version='1.0'>
12
13
14
15 <!--############################################################################# -->
16 <!-- DOCUMENTATION                                                                -->
17 <doc:reference id="xref" xmlns="">
18 <referenceinfo> 
19 <releaseinfo role="meta">
20 </releaseinfo>
21 <authorgroup>
22 <author> <surname>Casellas</surname><firstname>Ramon</firstname> </author>
23 <author> <surname>James</surname><firstname>Devenish</firstname> </author>
24 </authorgroup>
25 <copyright> 
26         <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
27         <holder>Ramon Casellas</holder>
28 </copyright>
29 </referenceinfo>
30
31 <title>Xref, Cross References <filename>xref.mod.xsl</filename></title>
32 <partintro>
33 <section><title>Introduction</title>
34 <para></para>
35 </section>
36 </partintro>
37 </doc:reference>
38
39
40
41
42 <!--############################################################################# -->
43 <doc:template match="anchor" xmlns="">
44   <refpurpose>Anchor XSL template</refpurpose>
45   <refdescription>
46     <para>The <sgmltag>anchor</sgmltag> element 
47     The DB2LaTeX processing of the element is quite straightforward :
48         Map to a <literal>\label</literal>.</para>
49   </refdescription>
50 </doc:template>
51 <!--############################################################################# -->
52
53     <xsl:template match="anchor">
54                 <xsl:text>\hypertarget{</xsl:text>
55                 <xsl:value-of select="@id"/>
56                 <xsl:text>}{}</xsl:text>
57     </xsl:template>
58
59
60
61
62
63 <!--############################################################################# -->
64 <doc:template name="id.is.xrefed" xmlns="">
65   <refpurpose>Auxiliary named template</refpurpose>
66   <refdescription>
67     <para>This template returns 1 if there exists somewhere an xref
68     whose linkend is the target's id.</para>
69   </refdescription>
70 </doc:template>
71 <!--############################################################################# -->
72
73     <xsl:template name="id.is.xrefed">
74         <xsl:param name="i" select="1"/>
75         <xsl:param name="target" select="."/>
76         <xsl:param name="xrefs" select="//xref"/>
77         <xsl:choose>
78             <xsl:when test="xrefs[i]/@linkend = 'target/@id'">
79                 <xsl:value-of select="1"/>
80             </xsl:when>
81             <xsl:when test="i = count(xrefs)">
82                 <xsl:value-of select="0"/>
83             </xsl:when>
84             <xsl:otherwise>
85                 <xsl:call-template name="id.is.xrefed">
86                     <xsl:with-param name="i" select="i+1"/>
87                 </xsl:call-template>
88             </xsl:otherwise>
89         </xsl:choose>
90     </xsl:template>
91
92
93
94
95
96 <!--############################################################################# -->
97 <doc:template name="xref.xreflabel" xmlns="">
98   <refpurpose>Auxiliary named template</refpurpose>
99   <refdescription>
100     <para> Called to process an xreflabel...you might use this to make 
101      xreflabels come out in the right font for different targets, 
102          for example.</para>
103   </refdescription>
104 </doc:template>
105 <!--############################################################################# -->
106
107     <xsl:template name="xref.xreflabel">
108         <xsl:param name="target" select="."/>
109         <xsl:value-of select="$target/@xreflabel"/>
110     </xsl:template>
111
112
113
114
115
116
117 <!--############################################################################# -->
118 <doc:template match="xref|link" xmlns="">
119   <refpurpose>Xref and Link XSL Template</refpurpose>
120   <refdescription>
121   </refdescription>
122 </doc:template>
123 <!--############################################################################# -->
124
125     <xsl:template match="xref|link">
126         <xsl:variable name="targets" select="id(@linkend)"/>
127         <xsl:variable name="target" select="$targets[1]"/>
128         <xsl:variable name="refelem" select="local-name($target)"/>
129         <xsl:call-template name="check.id.unique"><xsl:with-param name="linkend" select="@linkend"/></xsl:call-template>
130         <xsl:choose>
131             <xsl:when test="$refelem=''">
132                 <xsl:message><xsl:text>XRef to nonexistent id: </xsl:text><xsl:value-of select="@linkend"/></xsl:message>
133                 <xsl:text>XrefId[?</xsl:text>
134                 <xsl:if test="local-name(.)='link'"><xsl:apply-templates/></xsl:if>
135                 <xsl:text>?]</xsl:text>
136             </xsl:when>
137
138             <!-- This is a link with content ... -->
139                 <xsl:when test="local-name(.)='link' and .!=''">
140                 <xsl:call-template name="generate.hyperlink">
141                         <xsl:with-param name="target" select="$target"/>
142                         <xsl:with-param name="text"><xsl:apply-templates/></xsl:with-param>
143                 </xsl:call-template>
144                 </xsl:when>
145                 
146             <xsl:otherwise>
147                 <xsl:choose>
148                     <xsl:when test="@endterm">
149                         <xsl:variable name="etargets" select="id(@endterm)"/>
150                         <xsl:variable name="etarget" select="$etargets[1]"/>
151                         <xsl:choose>
152                             <xsl:when test="count($etarget) = 0">
153                                 <xsl:message>
154                                     <xsl:value-of select="count($etargets)"/>
155                                     <xsl:text>Endterm points to nonexistent ID: </xsl:text>
156                                     <xsl:value-of select="@endterm"/>
157                                 </xsl:message>
158                                 <xsl:text>[NONEXISTENT ID]</xsl:text>
159                             </xsl:when>
160                             <xsl:otherwise>
161                                 <xsl:call-template name="generate.hyperlink">
162                                         <xsl:with-param name="target" select="$target"/>
163                                         <xsl:with-param name="text"><xsl:apply-templates select="$etarget" mode="xref.text"/></xsl:with-param>
164                                 </xsl:call-template>
165                             </xsl:otherwise>
166                         </xsl:choose>
167                     </xsl:when>
168                         <!-- If an xreflabel has been specified for the target ... -->
169                         <xsl:when test="local-name(.)='xref' and $target/@xreflabel">
170                         <xsl:call-template name="generate.hyperlink">
171                                 <xsl:with-param name="target" select="$target"/>
172                                 <xsl:with-param name="text">
173                                         <xsl:text>{[</xsl:text>
174                                         <xsl:call-template name="xref.xreflabel">
175                                                 <xsl:with-param name="target" select="$target"/>
176                                         </xsl:call-template>
177                                         <xsl:text>]}</xsl:text>
178                                 </xsl:with-param>
179                         </xsl:call-template>
180                         </xsl:when>
181                     <xsl:otherwise>
182                                 <xsl:call-template name="generate.hyperlink">
183                                         <xsl:with-param name="target" select="$target"/>
184                                         <xsl:with-param name="text"><xsl:apply-templates select="$target" mode="xref-to"/></xsl:with-param>
185                                 </xsl:call-template>
186                     </xsl:otherwise>
187                 </xsl:choose>
188             </xsl:otherwise>
189         </xsl:choose>
190         <xsl:if test="$insert.xref.page.number=1 and $refelem!='' and local-name(.)='xref'">
191                 <xsl:call-template name="xref.p.subst">
192                         <xsl:with-param name="string">
193                                 <xsl:call-template name="gentext.xref.text">
194                                 <xsl:with-param name="element.name" select="'page.citation'"/>
195                                 <xsl:with-param name="default"> [%p]</xsl:with-param>
196                                 </xsl:call-template>
197                         </xsl:with-param>
198                         <xsl:with-param name="target" select="$target"/>
199                 </xsl:call-template>
200         </xsl:if>
201     </xsl:template>
202
203         <doc:template name="generate.hyperlink" xmlns="">
204         <refpurpose> Choose hyperlink syntax </refpurpose>
205         <refdescription>
206                 <para>Will use hyperref, if it is available. Otherwise, just outputs
207                 unlinked text. If the destination is a citation, a backreference is
208                 emitted (even though it is technically a hyperlink, not a citation).
209                 If the 'text' arises from an @endterm, then the 'optional argument'
210                 syntax of <literal>\cite</literal> is used.</para>
211         </refdescription>
212         </doc:template>
213         <xsl:template name="generate.hyperlink">
214                 <xsl:param name="target"/>
215                 <xsl:param name="text"/>
216                 <xsl:variable name="element" select="local-name($target)"/>
217                 <xsl:variable name="citation" select="$element='biblioentry' or $element='bibliomixed'"/>
218                 <xsl:choose>
219                         <xsl:when test="$citation and @endterm!=''">
220                                 <xsl:text>\docbooktolatexcite</xsl:text>
221                                 <xsl:text>{</xsl:text>
222                                 <xsl:value-of select="$target/@id"/>
223                                 <xsl:text>}{</xsl:text>
224                                 <xsl:call-template name="scape-optionalarg">
225                                         <xsl:with-param name="string" select="$text"/>
226                                 </xsl:call-template>
227                                 <xsl:text>}</xsl:text>
228                         </xsl:when>
229                         <xsl:otherwise>
230                                 <xsl:if test="$latex.use.hyperref=1">
231                                         <xsl:text>\hyperlink{</xsl:text>
232                                         <xsl:value-of select="$target/@id"/>
233                                         <xsl:text>}</xsl:text>
234                                 </xsl:if>
235                                 <xsl:text>{</xsl:text>
236                                 <xsl:if test="$citation">
237                                         <xsl:text>\docbooktolatexbackcite{</xsl:text>
238                                         <xsl:value-of select="$target/@id"/>
239                                         <xsl:text>}</xsl:text>
240                                 </xsl:if>
241                                 <xsl:value-of select="$text"/>
242                                 <xsl:text>}</xsl:text>
243                         </xsl:otherwise>
244                 </xsl:choose>
245         </xsl:template>
246
247         <doc:template name="xref.p.subst" xmlns="">
248                 <refpurpose>Insert page number into xrefs</refpurpose>
249                 <refdescription><para></para></refdescription>
250         </doc:template>
251         <xsl:template name="xref.p.subst">
252                 <xsl:param name="string"></xsl:param>
253                 <xsl:param name="target" select="."/>
254                 <xsl:variable name="subst">%p</xsl:variable>
255                 <xsl:choose>
256                         <xsl:when test="contains($string, $subst)">
257                                 <xsl:value-of select="substring-before($string, $subst)"/>
258                                 <xsl:text>\pageref*{</xsl:text>
259                                 <xsl:value-of select="$target/@id"/>
260                                 <xsl:text>}</xsl:text>
261                                 <xsl:value-of select="substring-after($string, $subst)"/>
262                         </xsl:when>
263                         <xsl:otherwise>
264                                 <xsl:value-of select="$string"/>
265                         </xsl:otherwise>
266                 </xsl:choose>
267         </xsl:template>
268
269
270
271
272
273
274
275 <!--############################################################################# -->
276 <doc:template name="number.xref" xmlns="">
277   <refpurpose>Numbering template</refpurpose>
278   <refdescription>
279         <para>
280     Let LaTeX manage the numbering. Otherwise sty files that 
281     do specify another numberic (e.g I,II) get messed
282         </para>
283   </refdescription>
284 </doc:template>
285 <!--############################################################################# -->
286
287     <xsl:template name="number.xref">
288                 <xsl:text>{\ref*{</xsl:text><xsl:value-of select="@id"/><xsl:text>}}</xsl:text>
289     </xsl:template>
290
291
292
293
294
295
296
297
298 <!--############################################################################# -->
299 <doc:template name="cross-reference" xmlns="">
300   <refpurpose>FIXME</refpurpose>
301   <refdescription>
302         <para>
303         FIXME
304         </para>
305   </refdescription>
306 </doc:template>
307 <!--############################################################################# -->
308
309     <xsl:template name="cross-reference">
310         <xsl:param name="target" select="."/>
311         <xsl:param name="refelem" select="local-name($target)"/>
312         <xsl:param name="xref.text">
313             <xsl:call-template name="gentext.xref.text">
314                 <xsl:with-param name="element.name" select="$refelem"/>
315                 <xsl:with-param name="default">%g %n</xsl:with-param>
316             </xsl:call-template>
317         </xsl:param>
318         <xsl:call-template name="subst.xref.text">
319             <xsl:with-param name="xref.text" select="$xref.text"/>
320             <xsl:with-param name="target" select="$target"/>
321         </xsl:call-template>
322     </xsl:template>
323
324
325
326
327
328     <xsl:template match="*" mode="xref-to">
329         <xsl:param name="target" select="."/>
330         <xsl:param name="refelem" select="local-name($target)"/>
331         <xsl:message>
332             <xsl:text>[Don't know what gentext to create for xref to: "</xsl:text>
333             <xsl:value-of select="$refelem"/>
334             <xsl:text>"]</xsl:text>
335         </xsl:message>
336         <xsl:text>UNKGENTEXT</xsl:text><xsl:value-of select="$refelem"/>
337     </xsl:template>
338
339
340
341
342
343     <xsl:template match="formalpara" mode="xref-to">
344         <xsl:param name="target" select="."/>
345         <xsl:param name="refelem" select="local-name($target)"/>
346         <xsl:call-template name="cross-reference">
347             <xsl:with-param name="target" select="$target"/>
348         </xsl:call-template>
349     </xsl:template>
350
351
352     <xsl:template match="figure|example|table|equation" mode="xref-to">
353         <xsl:param name="target" select="."/>
354         <xsl:param name="refelem" select="local-name($target)"/>
355         <xsl:call-template name="cross-reference">
356             <xsl:with-param name="target" select="$target"/>
357         </xsl:call-template>
358     </xsl:template>
359
360
361     <xsl:template match="dedication|preface|part|chapter|appendix" mode="xref-to">
362         <xsl:param name="target" select="."/>
363         <xsl:param name="refelem" select="local-name($target)"/>
364         <xsl:call-template name="cross-reference">
365             <xsl:with-param name="target" select="$target"/>
366         </xsl:call-template>
367     </xsl:template>
368
369     <xsl:template match="cmdsynopsis" mode="xref-to">
370         <xsl:param name="target" select="."/>
371         <xsl:param name="refelem" select="local-name($target)"/>
372         <xsl:variable name="command" select="($target//command)[1]"/>
373         <xsl:apply-templates select="$command" mode="xref"/>
374     </xsl:template>
375
376     <xsl:template match="funcsynopsis" mode="xref-to">
377         <xsl:param name="target" select="."/>
378         <xsl:param name="refelem" select="local-name($target)"/>
379         <xsl:variable name="func" select="($target//function)[1]"/>
380         <xsl:apply-templates select="$func" mode="xref"/>
381     </xsl:template>
382
383
384     <xsl:template match="biblioentry" mode="xref-to">
385         <!-- handles both biblioentry and bibliomixed -->
386         <xsl:param name="target" select="."/>
387         <xsl:param name="refelem" select="local-name($target)"/>
388         <xsl:text>[</xsl:text>
389         <xsl:choose>
390             <xsl:when test="local-name($target/*[1]) = 'abbrev'">
391                 <xsl:apply-templates select="$target/*[1]"/>
392             </xsl:when>
393             <xsl:otherwise>
394                 <xsl:value-of select="@id"/>
395             </xsl:otherwise>
396         </xsl:choose>
397         <xsl:text>]</xsl:text>
398     </xsl:template>
399
400
401
402     <xsl:template match="bibliography|glossary|index" mode="xref-to">
403         <xsl:param name="target" select="."/>
404         <xsl:param name="refelem" select="local-name($target)"/>
405         <xsl:call-template name="cross-reference">
406             <xsl:with-param name="target" select="$target"/>
407         </xsl:call-template>
408     </xsl:template>
409
410
411     <xsl:template match="section|simplesect
412         |sect1|sect2|sect3|sect4|sect5
413         |refsect1|refsect2|refsect3" mode="xref-to">
414         <xsl:param name="target" select="."/>
415         <xsl:param name="refelem" select="local-name($target)"/>
416         <xsl:call-template name="cross-reference">
417             <xsl:with-param name="target" select="$target"/>
418         </xsl:call-template>
419     </xsl:template>
420
421     <xsl:template match="question|answer" mode="xref-to">
422         <xsl:param name="target" select="."/>
423         <xsl:param name="refelem" select="local-name($target)"/>
424         <xsl:call-template name="cross-reference">
425             <xsl:with-param name="target" select="$target"/>
426         </xsl:call-template>
427     </xsl:template>
428
429     <xsl:template match="reference" mode="xref-to">
430         <xsl:param name="target" select="."/>
431         <xsl:param name="refelem" select="local-name($target)"/>
432         <xsl:call-template name="cross-reference">
433             <xsl:with-param name="target" select="$target"/>
434         </xsl:call-template>
435     </xsl:template>
436
437     <xsl:template match="co" mode="xref-to">
438         <xsl:param name="target" select="."/>
439         <xsl:param name="refelem" select="local-name($target)"/>
440         <xsl:apply-templates select="$target" mode="callout-bug"/>
441     </xsl:template>
442
443     <xsl:template match="co" mode="conumber">
444         <xsl:number from="literallayout|programlisting|screen|synopsis"
445             level="single"
446             format="1"/>
447     </xsl:template>
448
449
450     <xsl:template match="book" mode="xref-to">
451         <xsl:param name="target" select="."/>
452         <xsl:param name="refelem" select="local-name($target)"/>
453         <xsl:variable name="title">
454             <xsl:choose>
455                 <xsl:when test="$target/title">
456                     <xsl:apply-templates select="$target/title" mode="xref"/>
457                 </xsl:when>
458                 <xsl:otherwise>
459                     <xsl:apply-templates select="$target/bookinfo/title" mode="xref"/>
460                 </xsl:otherwise>
461             </xsl:choose>
462         </xsl:variable>
463         <xsl:text>{\em </xsl:text> <xsl:copy-of select="$title"/> <xsl:text>}</xsl:text>
464     </xsl:template>
465
466
467     <xsl:template match="command" mode="xref">
468         <xsl:call-template name="inline.boldseq"/>
469     </xsl:template>
470
471     <xsl:template match="function" mode="xref">
472         <xsl:call-template name="inline.monoseq"/>
473     </xsl:template>
474
475
476
477
478 <!--############################################################################# -->
479 <doc:template match="ulink" xmlns="">
480   <refpurpose>A link that addresses its target by means of a URL (Uniform Resource Locator)</refpurpose>
481   <refdescription>
482         <formalpara>
483                 <title>Pertinent Variables</title>
484                 <itemizedlist>
485                         <listitem><simpara><xref linkend="param.ulink.show"/></simpara></listitem>
486                         <listitem><simpara><xref linkend="param.ulink.footnotes"/></simpara></listitem>
487                         <listitem><simpara><xref linkend="latex.hyphenation.tttricks"/></simpara></listitem>
488                 </itemizedlist>
489         </formalpara>
490   </refdescription>
491 </doc:template>
492 <!--############################################################################# -->
493
494
495     <xsl:template match="ulink" name="ulink">
496         <xsl:param name="hyphenation">\docbookhyphenateurl</xsl:param>
497         <xsl:param name="url" select="@url"/>
498         <xsl:choose>
499                 <xsl:when test=". = '' or . = $url">
500                         <xsl:call-template name="generate.typeset.url">
501                                 <xsl:with-param name="hyphenation" select="$hyphenation"/>
502                                 <xsl:with-param name="url" select="$url"/>
503                         </xsl:call-template>
504                 </xsl:when>
505                 <xsl:when test="$latex.use.tabularx=1 and count(ancestor::table)&gt;0">
506                         <xsl:apply-templates/>
507                         <xsl:text> </xsl:text>
508                         <xsl:call-template name="generate.typeset.url">
509                                 <xsl:with-param name="hyphenation" select="$hyphenation"/>
510                                 <xsl:with-param name="url" select="$url"/>
511                         </xsl:call-template>
512                 </xsl:when>
513                 <xsl:when test="$ulink.footnotes='1' or $ulink.show='1'">
514                         <xsl:apply-templates/>
515                         <xsl:if test="$ulink.footnotes='1' and count(ancestor::footnote)=0">
516                                 <xsl:call-template name="footnote">
517                                         <xsl:with-param name="hyphenation" select="$hyphenation"/>
518                                         <xsl:with-param name="url" select="$url"/>
519                                 </xsl:call-template>
520                         </xsl:if>
521                         <xsl:if test="$ulink.show='1' or ($ulink.footnotes='1' and ancestor::footnote)">
522                                 <xsl:text> </xsl:text>
523                                 <xsl:call-template name="generate.typeset.url">
524                                         <xsl:with-param name="hyphenation" select="$hyphenation"/>
525                                         <xsl:with-param name="url" select="$url"/>
526                                 </xsl:call-template>
527                         </xsl:if>
528                 </xsl:when>
529                 <xsl:otherwise>
530                         <xsl:text>\href{</xsl:text>
531                                 <xsl:call-template name="scape-href">
532                                         <xsl:with-param name="string" select="$url"/>
533                                 </xsl:call-template>
534                         <xsl:text>}</xsl:text>
535                         <xsl:text>{</xsl:text>
536                                 <xsl:apply-templates/>
537                         <xsl:text>}</xsl:text><!-- End Of second argument of \href -->
538                 </xsl:otherwise>
539         </xsl:choose>
540     </xsl:template>
541
542
543
544
545 <!--############################################################################# -->
546 <doc:template match="olink" xmlns="">
547   <refpurpose>OLink XSL template</refpurpose>
548   <refdescription>
549   <para></para>
550   </refdescription>
551 </doc:template>
552 <!--############################################################################# -->
553
554     <xsl:template match="olink">
555                 <xsl:apply-templates/>
556     </xsl:template>
557
558
559
560
561
562
563
564 <!--############################################################################# -->
565     <xsl:template name="title.xref">
566         <xsl:param name="target" select="."/>
567         <xsl:choose>
568             <xsl:when test="name($target) = 'figure'
569                 or name($target) = 'example'
570                 or name($target) = 'equation'
571                 or name($target) = 'table'
572                 or name($target) = 'dedication'
573                 or name($target) = 'preface'
574                 or name($target) = 'bibliography'
575                 or name($target) = 'glossary'
576                 or name($target) = 'index'
577                 or name($target) = 'setindex'
578                 or name($target) = 'colophon'">
579                 <xsl:call-template name="gentext.startquote"/>
580                 <xsl:apply-templates select="$target" mode="title.content"/>
581                 <xsl:call-template name="gentext.endquote"/>
582             </xsl:when>
583             <xsl:otherwise>
584                 <xsl:text>{\em </xsl:text><xsl:apply-templates select="$target" mode="title.content"/><xsl:text>}</xsl:text>
585             </xsl:otherwise>
586         </xsl:choose>
587     </xsl:template>
588
589
590 <!--############################################################################# -->
591     <xsl:template match="title" mode="xref">
592         <xsl:apply-templates/>
593     </xsl:template>
594
595     <xsl:template match="command" mode="xref">
596         <xsl:call-template name="inline.boldseq"/>
597     </xsl:template>
598
599     <xsl:template match="function" mode="xref">
600         <xsl:call-template name="inline.monoseq"/>
601     </xsl:template>
602
603         <xsl:template name="generate.typeset.url">
604                 <xsl:param name="hyphenation"/>
605                 <xsl:param name="url" select="@url"/>
606                 <xsl:choose>
607                         <xsl:when test="$latex.use.url='1'">
608                                 <xsl:text>\url{</xsl:text>
609                                 <xsl:value-of select="$url"/>
610                                 <xsl:text>}</xsl:text>
611                         </xsl:when>
612                         <xsl:otherwise>
613                                 <xsl:text>\href{</xsl:text>
614                                 <xsl:call-template name="scape-href">
615                                         <xsl:with-param name="string" select="$url"/>
616                                 </xsl:call-template>
617                                 <xsl:text>}{\texttt{</xsl:text>
618                                 <xsl:call-template name="generate.string.url">
619                                         <xsl:with-param name="hyphenation" select="$hyphenation"/>
620                                         <xsl:with-param name="string" select="$url"/>
621                                 </xsl:call-template>
622                                 <xsl:text>}}</xsl:text>
623                         </xsl:otherwise>
624                 </xsl:choose>
625         </xsl:template>
626
627 <!--############################################################################# -->
628         <doc:template name="generate.string.url" xmlns="">
629                 <refpurpose>Escape and hyphenate a string as a teletype URL.</refpurpose>
630                 <refdescription>
631                 <para>
632                 This template typsets teletype text using slash.hyphen if
633                 $latex.hyphenation.tttricks is disabled.
634                 Has two parameters: 'hyphenation' and 'string'.
635                 </para>
636                 </refdescription>
637         </doc:template>
638 <!--############################################################################# -->
639         <xsl:template name="generate.string.url">
640                 <xsl:param name="hyphenation" />
641                 <xsl:param name="string" />
642                 <xsl:param name="url" select="$string"/>
643                 <xsl:choose>
644                         <xsl:when test="$latex.hyphenation.tttricks=1">
645                                 <xsl:value-of select="$hyphenation" />
646                                 <xsl:text>{</xsl:text>
647                                 <xsl:call-template name="normalize-scape"><xsl:with-param name="string" select="$string"/></xsl:call-template>
648                                 <xsl:text>}</xsl:text>
649                         </xsl:when>
650                         <xsl:otherwise>
651                                 <!-- LaTeX chars are scaped. Each / except the :// is mapped to a /\- -->
652                                 <xsl:call-template name="scape.slash.hyphen"><xsl:with-param name="string" select="$url"/></xsl:call-template>
653                         </xsl:otherwise>
654                 </xsl:choose>
655         </xsl:template>
656
657 </xsl:stylesheet>