ba1d034b7e70c88be8759bc044cbb1953160b27e
[project-aon.git] / xml / xhtml.xsl
1 <?xml version="1.0"?>
2 <!DOCTYPE xsl:transform [
3  <!ENTITY % xhtml.characters SYSTEM "../../en/xml/htmlchar.mod">
4  %xhtml.characters;
5 ]>
6
7 <!--
8
9 $Id$
10
11 $Log$
12 Revision 1.7  2006/03/09 18:56:33  jonathan.blake
13 Added a language parameter and coding to switch between languages when the output is hard-coded into the transformation.
14
15 Revision 1.5  2006/03/02 00:33:32  jonathan.blake
16 Removed the 'book-path' parameter to work with new gbtoxhtml.pl
17
18 Revision 1.4  2005/12/27 01:51:29  angantyr
19 Added templates for the "bookref" and "footref" elements.
20
21 Revision 1.3  2005/12/05 21:29:04  jonathan.blake
22 Added the facilities to properly handle character elements.
23
24 Revision 1.2  2005/04/09 19:51:50  angantyr
25 Added handling of open-ended quotes.
26
27 Revision 1.1  2005/01/30 01:32:52  jonathan.blake
28 Initial freepository revision of XML support documents.
29
30 Revision 1.12  2003/10/07 06:05:14  Jon
31 Added capability for "accent" illustrations.
32
33 Revision 1.11  2002/12/06 22:12:04  jblake
34 Added default namespace declaration to transformation element
35 and removed all the extraneous declarations in the template
36 elements.
37
38 Revision 1.10  2002/11/17 22:37:25  jblake
39 Removed the "medium" creator entry from the templates.
40 Will they be of any use?
41
42 Revision 1.9  2002/11/17 05:06:56  jblake
43 Rearranged the title page.
44
45 Revision 1.8  2002/11/15 19:35:25  jblake
46 Fixed "Content-type" of XHTML output.
47
48 Revision 1.7  2002/11/15 00:15:39  jblake
49 Fixed a problem with the client-side image map and fixed
50 the numbered section list generation so that it will work
51 for Shadow on the Sand.
52
53 Revision 1.6  2002/10/30 05:59:45  jblake
54 Added a value for the alt attribute of the ToC image on the navigation bar.
55
56 Revision 1.5  2002/10/24 15:53:41  jblake
57 Fixed a conflict with whitespace and paragraphed lists.
58
59 Revision 1.4  2002/10/24 15:06:51  jblake
60 Added xmlns attributes to all elements that are top level in
61 their templates. This was an adjustment required by Xalan-J 2.4.
62
63 Also reinstated the comment in each document since the new
64 version of Xalan redirects it properly.
65
66 Revision 1.3  2002/10/23 05:18:29  jblake
67 Added the capability to filter which illustrators' work is used.
68 This is accomplished by the "use-illustrators" parameter.
69
70 Revision 1.2  2002/10/20 06:25:35  jblake
71 Added support for CLOSE COMBAT SKILL for Freeway Warrior books.
72
73 Revision 1.1  2002/10/15 23:29:51  jblake
74 Initial revision
75
76
77 20020327 - repurposed to be used with Xalan Java 2
78
79 Todo:
80
81 * Add blank whitespace handling to the paragraphed list template
82
83 -->
84
85 <xsl:transform version="1.0"
86   xmlns="http://www.w3.org/1999/xhtml"
87   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
88   xmlns:lxslt="http://xml.apache.org/xslt"
89   xmlns:redirect="org.apache.xalan.lib.Redirect"
90   extension-element-prefixes="redirect">
91
92 <xsl:output method="xml"
93             encoding="ISO-8859-1"
94             omit-xml-declaration="yes"
95             doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
96             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
97
98 <xsl:strip-space elements="section data ol ul dl li dd footnotes footnote" />
99 <xsl:preserve-space elements="p choice" />
100
101 <!-- ====================== parameters ========================== -->
102
103 <xsl:param name="use-illustrators" />
104 <xsl:param name="language"><xsl:text>en</xsl:text></xsl:param>
105  
106 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ colors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
107
108 <xsl:param name="link-color"><xsl:text>#ff0000</xsl:text></xsl:param>
109 <xsl:param name="alink-color"><xsl:value-of select="$link-color" /></xsl:param>
110 <xsl:param name="vlink-color"><xsl:value-of select="$link-color" /></xsl:param>
111
112 <xsl:param name="text-color"><xsl:text>#000000</xsl:text></xsl:param>
113 <xsl:param name="background-color"><xsl:text>#ffffe4</xsl:text></xsl:param>
114
115 <!-- ======================= variables ========================== -->
116
117 <xsl:variable name="newline">
118 <xsl:text>
119 </xsl:text>
120 </xsl:variable>
121
122 <!-- ======================== Templates ========================= -->
123
124 <!-- ================= hierarchical sections ==================== -->
125
126 <xsl:template match="meta" />
127 <xsl:template match="section" />
128
129 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
130
131 <xsl:template match="/gamebook/section[@id='title']">
132  <xsl:call-template name="xhtml-wrapper">
133   <xsl:with-param name="document-type">top-level</xsl:with-param>
134   <xsl:with-param name="filename">title</xsl:with-param>
135  </xsl:call-template>
136
137  <xsl:apply-templates />
138 </xsl:template>
139
140 <xsl:template match="/gamebook/section[@id='toc']">
141  <xsl:call-template name="xhtml-wrapper">
142   <xsl:with-param name="document-type">toc</xsl:with-param>
143   <xsl:with-param name="filename">toc</xsl:with-param>
144  </xsl:call-template>
145
146  <xsl:apply-templates />
147 </xsl:template>
148
149 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
150
151 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
152  <xsl:call-template name="xhtml-wrapper">
153   <xsl:with-param name="document-type">second-level-frontmatter</xsl:with-param>
154   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
155  </xsl:call-template>
156 </xsl:template>
157
158 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
159
160 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
161  <h3><xsl:value-of select="meta/title[1]" /></h3>
162
163  <xsl:value-of select="$newline" />
164  <xsl:value-of select="$newline" />
165
166  <xsl:apply-templates />
167 </xsl:template>
168
169 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
170  <xsl:call-template name="xhtml-wrapper">
171   <xsl:with-param name="document-type">third-level-frontmatter-separate</xsl:with-param>
172   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
173  </xsl:call-template>
174 </xsl:template>
175
176 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
177
178 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
179  <h4><xsl:value-of select="meta/title[1]" /></h4>
180
181  <xsl:value-of select="$newline" />
182  <xsl:value-of select="$newline" />
183
184  <xsl:apply-templates />
185 </xsl:template>
186
187 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
188
189 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
190  <h5><xsl:value-of select="meta/title[1]" /></h5>
191
192  <xsl:value-of select="$newline" />
193  <xsl:value-of select="$newline" />
194
195  <xsl:apply-templates />
196 </xsl:template>
197
198 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
199
200 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
201  <xsl:call-template name="xhtml-wrapper">
202   <xsl:with-param name="document-type">second-level-mainmatter</xsl:with-param>
203   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
204  </xsl:call-template>
205 </xsl:template>
206
207 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
208
209 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
210  <h3><xsl:value-of select="meta/title[1]" /></h3>
211
212  <xsl:value-of select="$newline" />
213  <xsl:value-of select="$newline" />
214
215  <xsl:apply-templates />
216 </xsl:template>
217
218 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter-separate']">
219  <xsl:call-template name="xhtml-wrapper">
220   <xsl:with-param name="document-type">third-level-mainmatter-separate</xsl:with-param>
221   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
222  </xsl:call-template>
223 </xsl:template>
224
225 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
226
227 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
228  <h4><xsl:value-of select="meta/title[1]" /></h4>
229
230  <xsl:value-of select="$newline" />
231  <xsl:value-of select="$newline" />
232
233  <xsl:apply-templates />
234 </xsl:template>
235
236 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
237
238 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
239  <h5><xsl:value-of select="meta/title[1]" /></h5>
240
241  <xsl:value-of select="$newline" />
242  <xsl:value-of select="$newline" />
243
244  <xsl:apply-templates />
245 </xsl:template>
246
247 <!-- :::::::::::: second-level glossary sections ::::::::::::: -->
248
249 <xsl:template match="/gamebook/section/data/section[@class='glossary']">
250  <xsl:call-template name="xhtml-wrapper">
251   <xsl:with-param name="document-type">second-level-glossary</xsl:with-param>
252   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
253   <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
254  </xsl:call-template>
255 </xsl:template>
256
257 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
258 <!-- glossary sections should be enclosed in a second level glossary section -->
259
260 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary']">
261  <h3><xsl:value-of select="meta/title[1]" /></h3>
262
263  <xsl:value-of select="$newline" />
264  <xsl:value-of select="$newline" />
265
266  <xsl:apply-templates />
267 </xsl:template>
268
269 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary-separate']">
270  <xsl:call-template name="xhtml-wrapper">
271   <xsl:with-param name="document-type">third-level-glossary-separate</xsl:with-param>
272   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
273   <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
274  </xsl:call-template>
275 </xsl:template>
276
277 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
278
279 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
280  <xsl:call-template name="xhtml-wrapper">
281   <xsl:with-param name="document-type">second-level-numbered</xsl:with-param>
282   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
283  </xsl:call-template>
284
285  <xsl:apply-templates />
286 </xsl:template>
287
288 <xsl:template match="/gamebook/section/data/section/data/section[@class='numbered']">
289  <xsl:call-template name="xhtml-wrapper">
290   <xsl:with-param name="document-type">third-level-numbered</xsl:with-param>
291   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
292  </xsl:call-template>
293 </xsl:template>
294
295 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
296
297 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
298  <xsl:call-template name="xhtml-wrapper">
299   <xsl:with-param name="document-type">second-level-backmatter</xsl:with-param>
300   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
301  </xsl:call-template>
302 </xsl:template>
303
304 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
305
306 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
307  <h3><xsl:value-of select="meta/title[1]" /></h3>
308
309  <xsl:value-of select="$newline" />
310  <xsl:value-of select="$newline" />
311
312  <xsl:apply-templates />
313 </xsl:template>
314
315 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
316
317 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
318  <h4><xsl:value-of select="meta/title[1]" /></h4>
319
320  <xsl:value-of select="$newline" />
321  <xsl:value-of select="$newline" />
322
323  <xsl:apply-templates />
324 </xsl:template>
325
326 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
327
328 <xsl:template match="id( 'map' )">
329  <xsl:call-template name="xhtml-wrapper">
330   <xsl:with-param name="document-type">map-adjusted</xsl:with-param>
331   <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
332  </xsl:call-template>
333
334  <xsl:call-template name="xhtml-wrapper">
335   <xsl:with-param name="document-type">map</xsl:with-param>
336   <xsl:with-param name="filename"><xsl:value-of select="@id" /><xsl:text>large</xsl:text></xsl:with-param>
337  </xsl:call-template>
338 </xsl:template>
339
340 <!-- ==================== block elements ======================== -->
341
342 <xsl:template match="p">
343  <p><xsl:apply-templates /></p>
344  <xsl:value-of select="$newline" />
345 </xsl:template>
346
347 <xsl:template match="p[@class='dedication']">
348  <p class="dedication"><xsl:apply-templates /></p>
349  <xsl:value-of select="$newline" />
350 </xsl:template>
351
352 <xsl:template match="dl[@class='paragraphed']/dd/node() | ol[@class='paragraphed']/li/node() | ul[@class='paragraphed']/li/node()">
353  <xsl:variable name="illustration-alt-text">
354   <xsl:choose>
355    <xsl:when test="$language='es'">
356     <xsl:text>ilustraci&oacute;n</xsl:text>
357    </xsl:when>
358    <xsl:otherwise>
359     <xsl:text>illustration</xsl:text>
360    </xsl:otherwise>
361   </xsl:choose>
362  </xsl:variable>
363
364  <xsl:choose>
365   <xsl:when test="self::p">
366    <xsl:apply-templates /><br /><br /><xsl:value-of select="$newline" />
367   </xsl:when>
368   <xsl:when test="self::dl">
369    <dl><xsl:value-of select="$newline" />
370     <xsl:apply-templates />
371    </dl><br /><br /><xsl:value-of select="$newline" />
372   </xsl:when>
373   <xsl:when test="self::ol">
374    <ol><xsl:value-of select="$newline" />
375     <xsl:apply-templates />
376    </ol><br /><br /><xsl:value-of select="$newline" />
377   </xsl:when>
378   <xsl:when test="self::ul">
379    <ul>
380     <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
381     <xsl:value-of select="$newline" />
382     <xsl:apply-templates />
383    </ul><br /><br /><xsl:value-of select="$newline" />
384   </xsl:when>
385   <xsl:when test="self::blockquote">
386    <blockquote><xsl:value-of select="$newline" />
387     <xsl:apply-templates />
388    </blockquote><xsl:value-of select="$newline" />
389   </xsl:when>
390   <xsl:when test="self::illustration">
391    <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
392    <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
393    <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
394
395    <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
396     <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
397      <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
398       <tr><xsl:value-of select="$newline" />
399        <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
400        <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
401        <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
402       </tr><xsl:value-of select="$newline" />
403       <tr><xsl:value-of select="$newline" />
404        <td><img src="brdrl.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
405        <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" border="0" align="middle" alt="[{$illustration-alt-text}]" /></td><xsl:value-of select="$newline" />
406        <td><img src="brdrr.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
407       </tr><xsl:value-of select="$newline" />
408       <tr><xsl:value-of select="$newline" />
409        <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
410        <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
411        <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
412       </tr><xsl:value-of select="$newline" />
413      </table><br /><xsl:value-of select="$newline" />
414     </div></div><xsl:value-of select="$newline" />
415    </xsl:if>
416   </xsl:when>
417   <xsl:otherwise>
418    <xsl:text>[error: paragraphed list template]</xsl:text>
419   </xsl:otherwise>
420  </xsl:choose>
421 </xsl:template>
422
423 <xsl:template match="ol">
424  <ol><xsl:value-of select="$newline" />
425   <xsl:apply-templates />
426  </ol><xsl:value-of select="$newline" />
427 </xsl:template>
428
429 <xsl:template match="ul">
430  <ul>
431   <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
432   <xsl:value-of select="$newline" />
433   <xsl:apply-templates />
434  </ul><xsl:value-of select="$newline" />
435 </xsl:template>
436
437 <xsl:template match="dl">
438  <dl><xsl:value-of select="$newline" />
439   <xsl:apply-templates />
440  </dl><xsl:value-of select="$newline" />
441 </xsl:template>
442
443 <xsl:template match="dt">
444  <dt><xsl:apply-templates /></dt>
445  <xsl:value-of select="$newline" />
446 </xsl:template>
447
448 <xsl:template match="dd">
449  <dd><xsl:apply-templates /></dd>
450  <xsl:value-of select="$newline" />
451 </xsl:template>
452
453 <xsl:template match="li">
454  <li><xsl:apply-templates /></li>
455  <xsl:value-of select="$newline" />
456 </xsl:template>
457
458 <xsl:template match="table">
459  <table border="1" cellspacing="0" cellpadding="2">
460   <xsl:apply-templates />
461  </table>
462  <xsl:value-of select="$newline" />
463 </xsl:template>
464
465 <xsl:template match="tr">
466  <tr>
467   <xsl:apply-templates />
468  </tr>
469 </xsl:template>
470
471 <xsl:template match="th">
472  <th>
473   <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
474   <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
475   <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
476   <xsl:apply-templates />
477  </th>
478 </xsl:template>
479
480 <xsl:template match="td">
481  <td>
482   <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
483   <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
484   <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
485   <xsl:apply-templates />
486  </td>
487 </xsl:template>
488
489 <xsl:template match="combat">
490  <p class="combat">
491   <xsl:apply-templates select="enemy" />
492   <xsl:text>: </xsl:text>
493   <xsl:choose>
494    <xsl:when test="enemy-attribute[@class='combatskill']">
495     <span class="smallcaps">
496      <xsl:choose>
497       <xsl:when test="$language='es'">
498        <xsl:text>DESTREZA&nbsp;EN&nbsp;EL&nbsp;COMBATE</xsl:text>
499       </xsl:when>
500       <xsl:otherwise>
501        <xsl:text>COMBAT&nbsp;SKILL</xsl:text>
502       </xsl:otherwise>
503      </xsl:choose>
504     </span>
505     <xsl:text>&nbsp;</xsl:text>
506     <xsl:value-of select="enemy-attribute[@class='combatskill']" />
507    </xsl:when>
508    <xsl:when test="enemy-attribute[@class='closecombatskill']">
509     <span class="smallcaps">
510      <xsl:choose>
511       <xsl:when test="$language='es'">
512        <xsl:text>CLOSE&nbsp;COMBAT&nbsp;SKILL</xsl:text>
513       </xsl:when>
514       <xsl:otherwise>
515        <xsl:text>CLOSE&nbsp;COMBAT&nbsp;SKILL</xsl:text>
516       </xsl:otherwise>
517      </xsl:choose>
518     </span>
519     <xsl:text>&nbsp;</xsl:text>
520     <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
521    </xsl:when>
522   </xsl:choose>
523   <xsl:text> &nbsp;&nbsp;</xsl:text>
524   <span class="smallcaps">
525     <xsl:choose>
526      <xsl:when test="$language='es'">
527       <xsl:text>RESISTENCIA</xsl:text>
528      </xsl:when>
529      <xsl:otherwise>
530       <xsl:text>ENDURANCE</xsl:text>
531     </xsl:otherwise>
532    </xsl:choose>
533   </span>
534   <xsl:choose>
535    <xsl:when test="enemy-attribute[@class='target']">
536     <xsl:choose>
537      <xsl:when test="$language='es'">
538       <xsl:text> (o </xsl:text><span class="smallcaps">BLANCOS</span><xsl:text>)</xsl:text>
539      </xsl:when>
540      <xsl:otherwise>
541       <xsl:text> (</xsl:text><span class="smallcaps">TARGET</span><xsl:text> points)</xsl:text>
542      </xsl:otherwise>
543     </xsl:choose>
544     <xsl:text>&nbsp;</xsl:text>
545     <xsl:value-of select="enemy-attribute[@class='target']" />
546    </xsl:when>
547    <xsl:when test="enemy-attribute[@class='resistance']">
548     <xsl:choose>
549      <xsl:when test="$language='es'"></xsl:when>
550      <xsl:otherwise>
551       <xsl:text> (</xsl:text><span class="smallcaps">RESISTANCE</span><xsl:text> points)</xsl:text>
552      </xsl:otherwise>
553     </xsl:choose>
554     <xsl:text>&nbsp;</xsl:text>
555     <xsl:value-of select="enemy-attribute[@class='resistance']" />
556    </xsl:when>
557    <xsl:otherwise>
558     <xsl:text>&nbsp;</xsl:text>
559     <xsl:value-of select="enemy-attribute[@class='endurance']" />
560    </xsl:otherwise>
561   </xsl:choose>
562  </p>
563  <xsl:value-of select="$newline" />
564 </xsl:template>
565
566 <xsl:template match="choice">
567  <xsl:variable name="link">
568   <xsl:value-of select="@idref" />
569  </xsl:variable>
570
571  <p class="choice">
572   <xsl:for-each select="* | text()">
573    <xsl:choose>
574     <xsl:when test="self::link-text">
575      <a href="{$link}.htm">
576       <xsl:apply-templates />
577      </a>
578     </xsl:when>
579     <xsl:otherwise>
580      <xsl:apply-templates select="." />
581     </xsl:otherwise>
582    </xsl:choose>
583   </xsl:for-each>
584  </p>
585  <xsl:value-of select="$newline" />
586 </xsl:template>
587
588 <xsl:template match="signpost">
589  <div class="signpost">
590   <xsl:apply-templates />
591  </div>
592  <xsl:value-of select="$newline" />
593 </xsl:template>
594
595 <xsl:template match="blockquote">
596  <blockquote><xsl:value-of select="$newline" />
597   <xsl:apply-templates /><xsl:value-of select="$newline" />
598  </blockquote><xsl:value-of select="$newline" />
599 </xsl:template>
600
601 <xsl:template match="illustration">
602  <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
603  <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
604  <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
605
606  <xsl:variable name="illustration-width-adjusted"><xsl:number value="$illustration-width div 2" /></xsl:variable>
607  <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height div 2" /></xsl:variable>
608
609  <xsl:variable name="illustration-alt-text">
610   <xsl:choose>
611    <xsl:when test="$language='es'">
612     <xsl:text>ilustraci&oacute;n</xsl:text>
613    </xsl:when>
614    <xsl:otherwise>
615     <xsl:text>illustration</xsl:text>
616    </xsl:otherwise>
617   </xsl:choose>
618  </xsl:variable>
619
620  <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
621   <xsl:choose>
622    <xsl:when test="@class='float'">
623     <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
624      <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
625       <tr><xsl:value-of select="$newline" />
626        <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
627        <td><img src="brdrtp.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
628        <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
629       </tr><xsl:value-of select="$newline" />
630       <tr><xsl:value-of select="$newline" />
631        <td><img src="brdrl.gif" width="32" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
632         <td>
633         <a>
634          <xsl:attribute name="href"><xsl:text>ill</xsl:text><xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="1" /><xsl:text>.htm</xsl:text></xsl:attribute>
635          <img src="{$illustration-src}" width="{$illustration-width-adjusted}" height="{$illustration-height-adjusted}" border="0" align="middle" alt="[{$illustration-alt-text}]" />
636         </a>
637        </td><xsl:value-of select="$newline" />
638        <td><img src="brdrr.gif" width="32" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
639       </tr><xsl:value-of select="$newline" />
640       <tr><xsl:value-of select="$newline" />
641        <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
642        <td><img src="brdrbt.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
643        <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt=""/></td><xsl:value-of select="$newline" />
644       </tr><xsl:value-of select="$newline" />
645      </table><br /><xsl:value-of select="$newline" />
646     </div></div><xsl:value-of select="$newline" />
647
648     <xsl:call-template name="xhtml-wrapper">
649      <xsl:with-param name="document-type">illustration</xsl:with-param>
650      <xsl:with-param name="filename"><xsl:text>ill</xsl:text><xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) ) ]" from="/" level="any" format="1" /></xsl:with-param>
651     </xsl:call-template>
652    </xsl:when>
653
654    <xsl:when test="@class='accent'" />
655
656    <xsl:otherwise>
657     <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
658      <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
659       <tr><xsl:value-of select="$newline" />
660        <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
661        <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
662        <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
663       </tr><xsl:value-of select="$newline" />
664       <tr><xsl:value-of select="$newline" />
665        <td><img src="brdrl.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
666        <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" border="0" align="middle" alt="[{$illustration-alt-text}]" /></td><xsl:value-of select="$newline" />
667        <td><img src="brdrr.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
668       </tr><xsl:value-of select="$newline" />
669       <tr><xsl:value-of select="$newline" />
670        <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
671        <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
672        <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
673       </tr><xsl:value-of select="$newline" />
674      </table><br /><xsl:value-of select="$newline" />
675     </div></div><xsl:value-of select="$newline" />
676    </xsl:otherwise>
677   </xsl:choose>
678
679  </xsl:if>
680 </xsl:template>
681
682 <xsl:template match="instance" />
683
684 <xsl:template match="footnotes" />
685
686 <xsl:template match="footnote" />
687
688 <xsl:template match="hr">
689  <hr />
690  <xsl:value-of select="$newline" />
691 </xsl:template>
692
693 <!-- ==================== inline elements ======================= -->
694
695 <xsl:template match="a">
696  <xsl:choose>
697   <xsl:when test="@href">
698    <a>
699     <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
700     <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
701     <xsl:apply-templates />
702    </a>
703   </xsl:when>
704   <xsl:otherwise>
705    <a>
706     <xsl:if test="@idref">
707      <xsl:variable name="my-idref" select="@idref" />
708      <xsl:attribute name="href">
709       <xsl:choose>
710        <!-- The order of these tests is deliberate. They are ordered roughly from most to least specific. -->
711        <xsl:when test="/gamebook/section[@id=$my-idref] | /gamebook/section/data/section[@id=$my-idref]">
712         <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
713        </xsl:when>
714        <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and @id=$my-idref]">
715         <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
716        </xsl:when>
717        <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and @id=$my-idref]">
718         <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
719        </xsl:when>
720        <xsl:when test="/gamebook/section/data/section/data/section[@class='numbered' and @id=$my-idref]">
721         <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
722        </xsl:when>
723        <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and @id=$my-idref]">
724         <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
725        </xsl:when>
726        <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and descendant::*[@id=$my-idref]]">
727         <xsl:value-of select="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
728        </xsl:when>
729        <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and descendant::*[@id=$my-idref]]">
730         <xsl:value-of select="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
731        </xsl:when>
732        <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and descendant::*[@id=$my-idref]]">
733         <xsl:value-of select="/gamebook/section/data/section/data/section[@class='glossary-separate' and descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
734        </xsl:when>
735        <xsl:when test="/gamebook/section/data/section[descendant::*[@id=$my-idref]]">
736         <xsl:value-of select="/gamebook/section/data/section[descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
737        </xsl:when>
738        <xsl:otherwise>
739         <xsl:text>[error: a template]</xsl:text>
740        </xsl:otherwise>
741       </xsl:choose>
742      </xsl:attribute>
743     </xsl:if>
744     <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
745     <xsl:apply-templates />
746    </a>
747   </xsl:otherwise>
748  </xsl:choose>
749 </xsl:template>
750
751 <!-- This template is obsolete, the "footref" element should be used instead -->
752 <xsl:template match="a[@class='footnote']">
753  <xsl:apply-templates />
754  <sup>
755   <a>
756    <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
757    <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
758    <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
759   </a>
760  </sup>
761 </xsl:template>
762
763 <xsl:template match="a[@class='accent-illustration']">
764  <xsl:for-each select="id( @idref )">
765   <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
766   <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
767   <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
768   <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
769    <img src="{$illustration-src}" class="accent" width="{$illustration-width}" height="{$illustration-height}" alt="" border="" align="left" />
770   </xsl:if>
771  </xsl:for-each>
772 </xsl:template>
773
774 <xsl:template match="bookref">
775  <a>
776   <xsl:attribute name="href">
777    <xsl:variable name="my-section">
778     <xsl:choose>
779      <xsl:when test="@section">
780       <xsl:value-of select="@section" />
781      </xsl:when>
782      <xsl:otherwise>
783       <xsl:text>title</xsl:text>
784      </xsl:otherwise>
785     </xsl:choose>
786    </xsl:variable>
787    <xsl:variable name="my-series">
788     <!-- If series is specified, go one directory back and then to series. Otherwise, add nothing. -->
789     <xsl:choose>
790      <xsl:when test="@series">
791       <xsl:text>/../</xsl:text><xsl:value-of select="@series" />
792      </xsl:when>
793      <xsl:otherwise>
794       <xsl:text></xsl:text>
795      </xsl:otherwise>
796     </xsl:choose>
797    </xsl:variable>
798    <xsl:text>..</xsl:text><xsl:value-of select="$my-series" /><xsl:text>/</xsl:text><xsl:value-of select="@book" /><xsl:text>/</xsl:text><xsl:value-of select="$my-section" /><xsl:text>.htm</xsl:text>
799   </xsl:attribute>
800   <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
801   <xsl:apply-templates />
802  </a>
803 </xsl:template>
804
805 <xsl:template match="footref">
806  <xsl:apply-templates />
807  <sup>
808   <a>
809    <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
810    <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
811    <xsl:number count="footref" from="/" level="any" format="1" />
812   </a>
813  </sup>
814 </xsl:template>
815
816 <xsl:template match="em">
817  <em><xsl:apply-templates /></em>
818 </xsl:template>
819
820 <xsl:template match="strong">
821  <strong><xsl:apply-templates /></strong>
822 </xsl:template>
823
824 <xsl:template match="thought">
825  <i><xsl:apply-templates /></i>
826 </xsl:template>
827
828 <xsl:template match="onomatopoeia">
829  <i><xsl:apply-templates /></i>
830 </xsl:template>
831
832 <xsl:template match="spell">
833  <i><xsl:apply-templates /></i>
834 </xsl:template>
835
836 <xsl:template match="item">
837  <xsl:apply-templates />
838 </xsl:template>
839
840 <xsl:template match="foreign">
841  <i><xsl:apply-templates /></i>
842 </xsl:template>
843
844 <xsl:template match="quote">
845  <xsl:text>&apos;</xsl:text>
846   <xsl:apply-templates />
847  <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>&apos;</xsl:text></xsl:if>
848 </xsl:template>
849
850 <xsl:template match="quote//quote">
851  <xsl:text>&quot;</xsl:text>
852   <xsl:apply-templates />
853  <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>&quot;</xsl:text></xsl:if>
854 </xsl:template>
855
856 <xsl:template match="cite">
857  <cite><xsl:apply-templates /></cite>
858 </xsl:template>
859
860 <xsl:template match="code">
861  <tt><xsl:apply-templates /></tt>
862 </xsl:template>
863
864 <xsl:template match="br">
865  <br />
866 </xsl:template>
867
868 <xsl:template match="typ[@class='attribute']">
869  <span class="smallcaps"><xsl:apply-templates /></span>
870 </xsl:template>
871
872 <!-- ==================== character elements ==================== -->
873 <!--
874
875 These templates define the mapping between the character elements used in
876 the Project Aon instances of Gamebook XML and the ISO-8859-1
877 characters.
878
879 Portions Copyright International Organization for Standardization 1986 
880 Permission to copy in any form is granted for use with conforming SGML 
881 systems and applications as defined in ISO 8879, provided this notice 
882 is included in all copies.
883
884 -->
885
886 <xsl:template match="ch.apos"><xsl:text>&#39;</xsl:text></xsl:template><!-- apostrophe = single quotation mark -->
887 <xsl:template match="ch.nbsp"><xsl:text>&#160;</xsl:text></xsl:template><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
888 <xsl:template match="ch.iexcl"><xsl:text>&#161;</xsl:text></xsl:template><!-- inverted exclamation mark, U+00A1 ISOnum -->
889 <xsl:template match="ch.cent"><xsl:text>&#162;</xsl:text></xsl:template><!-- cent sign, U+00A2 ISOnum -->
890 <xsl:template match="ch.pound"><xsl:text>&#163;</xsl:text></xsl:template><!-- pound sign, U+00A3 ISOnum -->
891 <xsl:template match="ch.curren"><xsl:text>&#164;</xsl:text></xsl:template><!-- currency sign, U+00A4 ISOnum -->
892 <xsl:template match="ch.yen"><xsl:text>&#165;</xsl:text></xsl:template><!-- yen sign = yuan sign, U+00A5 ISOnum -->
893 <xsl:template match="ch.brvbar"><xsl:text>&#166;</xsl:text></xsl:template><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
894 <xsl:template match="ch.sect"><xsl:text>&#167;</xsl:text></xsl:template><!-- section sign, U+00A7 ISOnum -->
895 <xsl:template match="ch.uml"><xsl:text>&#168;</xsl:text></xsl:template><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
896 <xsl:template match="ch.copy"><xsl:text>&#169;</xsl:text></xsl:template><!-- copyright sign, U+00A9 ISOnum -->
897 <xsl:template match="ch.ordf"><xsl:text>&#170;</xsl:text></xsl:template><!-- feminine ordinal indicator, U+00AA ISOnum -->
898 <xsl:template match="ch.laquo"><xsl:text>&#171;</xsl:text></xsl:template><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
899 <xsl:template match="ch.not"><xsl:text>&#172;</xsl:text></xsl:template><!-- not sign, U+00AC ISOnum -->
900 <xsl:template match="ch.shy"><xsl:text>&#173;</xsl:text></xsl:template><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
901 <xsl:template match="ch.reg"><xsl:text>&#174;</xsl:text></xsl:template><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
902 <xsl:template match="ch.macr"><xsl:text>&#175;</xsl:text></xsl:template><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
903 <xsl:template match="ch.deg"><xsl:text>&#176;</xsl:text></xsl:template><!-- degree sign, U+00B0 ISOnum -->
904 <xsl:template match="ch.plusmn"><xsl:text>&#177;</xsl:text></xsl:template><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
905 <xsl:template match="ch.sup2"><xsl:text>&#178;</xsl:text></xsl:template><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
906 <xsl:template match="ch.sup3"><xsl:text>&#179;</xsl:text></xsl:template><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
907 <xsl:template match="ch.acute"><xsl:text>&#180;</xsl:text></xsl:template><!-- acute accent = spacing acute, U+00B4 ISOdia -->
908 <xsl:template match="ch.micro"><xsl:text>&#181;</xsl:text></xsl:template><!-- micro sign, U+00B5 ISOnum -->
909 <xsl:template match="ch.para"><xsl:text>&#182;</xsl:text></xsl:template><!-- pilcrow sign  = paragraph sign, U+00B6 ISOnum -->
910 <xsl:template match="ch.middot"><xsl:text>&#183;</xsl:text></xsl:template><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
911 <xsl:template match="ch.cedil"><xsl:text>&#184;</xsl:text></xsl:template><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
912 <xsl:template match="ch.sup1"><xsl:text>&#185;</xsl:text></xsl:template><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
913 <xsl:template match="ch.ordm"><xsl:text>&#186;</xsl:text></xsl:template><!-- masculine ordinal indicator, U+00BA ISOnum -->
914 <xsl:template match="ch.raquo"><xsl:text>&#187;</xsl:text></xsl:template><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
915 <xsl:template match="ch.frac14"><xsl:text>&#188;</xsl:text></xsl:template><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
916 <xsl:template match="ch.frac12"><xsl:text>&#189;</xsl:text></xsl:template><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
917 <xsl:template match="ch.frac34"><xsl:text>&#190;</xsl:text></xsl:template><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
918 <xsl:template match="ch.iquest"><xsl:text>&#191;</xsl:text></xsl:template><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
919 <xsl:template match="ch.Agrave"><xsl:text>&#192;</xsl:text></xsl:template><!-- latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1 -->
920 <xsl:template match="ch.Aacute"><xsl:text>&#193;</xsl:text></xsl:template><!-- latin capital letter A with acute, U+00C1 ISOlat1 -->
921 <xsl:template match="ch.Acirc"><xsl:text>&#194;</xsl:text></xsl:template><!-- latin capital letter A with circumflex, U+00C2 ISOlat1 -->
922 <xsl:template match="ch.Atilde"><xsl:text>&#195;</xsl:text></xsl:template><!-- latin capital letter A with tilde, U+00C3 ISOlat1 -->
923 <xsl:template match="ch.Auml"><xsl:text>&#196;</xsl:text></xsl:template><!-- latin capital letter A with diaeresis, U+00C4 ISOlat1 -->
924 <xsl:template match="ch.Aring"><xsl:text>&#197;</xsl:text></xsl:template><!-- latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1 -->
925 <xsl:template match="ch.AElig"><xsl:text>&#198;</xsl:text></xsl:template><!-- latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 -->
926 <xsl:template match="ch.Ccedil"><xsl:text>&#199;</xsl:text></xsl:template><!-- latin capital letter C with cedilla, U+00C7 ISOlat1 -->
927 <xsl:template match="ch.Egrave"><xsl:text>&#200;</xsl:text></xsl:template><!-- latin capital letter E with grave, U+00C8 ISOlat1 -->
928 <xsl:template match="ch.Eacute"><xsl:text>&#201;</xsl:text></xsl:template><!-- latin capital letter E with acute, U+00C9 ISOlat1 -->
929 <xsl:template match="ch.Ecirc"><xsl:text>&#202;</xsl:text></xsl:template><!-- latin capital letter E with circumflex, U+00CA ISOlat1 -->
930 <xsl:template match="ch.Euml"><xsl:text>&#203;</xsl:text></xsl:template><!-- latin capital letter E with diaeresis, U+00CB ISOlat1 -->
931 <xsl:template match="ch.Igrave"><xsl:text>&#204;</xsl:text></xsl:template><!-- latin capital letter I with grave, U+00CC ISOlat1 -->
932 <xsl:template match="ch.Iacute"><xsl:text>&#205;</xsl:text></xsl:template><!-- latin capital letter I with acute, U+00CD ISOlat1 -->
933 <xsl:template match="ch.Icirc"><xsl:text>&#206;</xsl:text></xsl:template><!-- latin capital letter I with circumflex, U+00CE ISOlat1 -->
934 <xsl:template match="ch.Iuml"><xsl:text>&#207;</xsl:text></xsl:template><!-- latin capital letter I with diaeresis, U+00CF ISOlat1 -->
935 <xsl:template match="ch.ETH"><xsl:text>&#208;</xsl:text></xsl:template><!-- latin capital letter ETH, U+00D0 ISOlat1 -->
936 <xsl:template match="ch.Ntilde"><xsl:text>&#209;</xsl:text></xsl:template><!-- latin capital letter N with tilde, U+00D1 ISOlat1 -->
937 <xsl:template match="ch.Ograve"><xsl:text>&#210;</xsl:text></xsl:template><!-- latin capital letter O with grave, U+00D2 ISOlat1 -->
938 <xsl:template match="ch.Oacute"><xsl:text>&#211;</xsl:text></xsl:template><!-- latin capital letter O with acute, U+00D3 ISOlat1 -->
939 <xsl:template match="ch.Ocirc"><xsl:text>&#212;</xsl:text></xsl:template><!-- latin capital letter O with circumflex, U+00D4 ISOlat1 -->
940 <xsl:template match="ch.Otilde"><xsl:text>&#213;</xsl:text></xsl:template><!-- latin capital letter O with tilde, U+00D5 ISOlat1 -->
941 <xsl:template match="ch.Ouml"><xsl:text>&#214;</xsl:text></xsl:template><!-- latin capital letter O with diaeresis, U+00D6 ISOlat1 -->
942 <xsl:template match="ch.times"><xsl:text>&#215;</xsl:text></xsl:template><!-- multiplication sign, U+00D7 ISOnum -->
943 <xsl:template match="ch.Oslash"><xsl:text>&#216;</xsl:text></xsl:template><!-- latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1 -->
944 <xsl:template match="ch.Ugrave"><xsl:text>&#217;</xsl:text></xsl:template><!-- latin capital letter U with grave, U+00D9 ISOlat1 -->
945 <xsl:template match="ch.Uacute"><xsl:text>&#218;</xsl:text></xsl:template><!-- latin capital letter U with acute, U+00DA ISOlat1 -->
946 <xsl:template match="ch.Ucirc"><xsl:text>&#219;</xsl:text></xsl:template><!-- latin capital letter U with circumflex, U+00DB ISOlat1 -->
947 <xsl:template match="ch.Uuml"><xsl:text>&#220;</xsl:text></xsl:template><!-- latin capital letter U with diaeresis, U+00DC ISOlat1 -->
948 <xsl:template match="ch.Yacute"><xsl:text>&#221;</xsl:text></xsl:template><!-- latin capital letter Y with acute, U+00DD ISOlat1 -->
949 <xsl:template match="ch.THORN"><xsl:text>&#222;</xsl:text></xsl:template><!-- latin capital letter THORN, U+00DE ISOlat1 -->
950 <xsl:template match="ch.szlig"><xsl:text>&#223;</xsl:text></xsl:template><!-- latin small letter sharp s = ess-zed, U+00DF ISOlat1 -->
951 <xsl:template match="ch.agrave"><xsl:text>&#224;</xsl:text></xsl:template><!-- latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1 -->
952 <xsl:template match="ch.aacute"><xsl:text>&#225;</xsl:text></xsl:template><!-- latin small letter a with acute, U+00E1 ISOlat1 -->
953 <xsl:template match="ch.acirc"><xsl:text>&#226;</xsl:text></xsl:template><!-- latin small letter a with circumflex, U+00E2 ISOlat1 -->
954 <xsl:template match="ch.atilde"><xsl:text>&#227;</xsl:text></xsl:template><!-- latin small letter a with tilde, U+00E3 ISOlat1 -->
955 <xsl:template match="ch.auml"><xsl:text>&#228;</xsl:text></xsl:template><!-- latin small letter a with diaeresis, U+00E4 ISOlat1 -->
956 <xsl:template match="ch.aring"><xsl:text>&#229;</xsl:text></xsl:template><!-- latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1 -->
957 <xsl:template match="ch.aelig"><xsl:text>&#230;</xsl:text></xsl:template><!-- latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 -->
958 <xsl:template match="ch.ccedil"><xsl:text>&#231;</xsl:text></xsl:template><!-- latin small letter c with cedilla, U+00E7 ISOlat1 -->
959 <xsl:template match="ch.egrave"><xsl:text>&#232;</xsl:text></xsl:template><!-- latin small letter e with grave, U+00E8 ISOlat1 -->
960 <xsl:template match="ch.eacute"><xsl:text>&#233;</xsl:text></xsl:template><!-- latin small letter e with acute, U+00E9 ISOlat1 -->
961 <xsl:template match="ch.ecirc"><xsl:text>&#234;</xsl:text></xsl:template><!-- latin small letter e with circumflex, U+00EA ISOlat1 -->
962 <xsl:template match="ch.euml"><xsl:text>&#235;</xsl:text></xsl:template><!-- latin small letter e with diaeresis, U+00EB ISOlat1 -->
963 <xsl:template match="ch.igrave"><xsl:text>&#236;</xsl:text></xsl:template><!-- latin small letter i with grave, U+00EC ISOlat1 -->
964 <xsl:template match="ch.iacute"><xsl:text>&#237;</xsl:text></xsl:template><!-- latin small letter i with acute, U+00ED ISOlat1 -->
965 <xsl:template match="ch.icirc"><xsl:text>&#238;</xsl:text></xsl:template><!-- latin small letter i with circumflex, U+00EE ISOlat1 -->
966 <xsl:template match="ch.iuml"><xsl:text>&#239;</xsl:text></xsl:template><!-- latin small letter i with diaeresis, U+00EF ISOlat1 -->
967 <xsl:template match="ch.eth"><xsl:text>&#240;</xsl:text></xsl:template><!-- latin small letter eth, U+00F0 ISOlat1 -->
968 <xsl:template match="ch.ntilde"><xsl:text>&#241;</xsl:text></xsl:template><!-- latin small letter n with tilde, U+00F1 ISOlat1 -->
969 <xsl:template match="ch.ograve"><xsl:text>&#242;</xsl:text></xsl:template><!-- latin small letter o with grave, U+00F2 ISOlat1 -->
970 <xsl:template match="ch.oacute"><xsl:text>&#243;</xsl:text></xsl:template><!-- latin small letter o with acute, U+00F3 ISOlat1 -->
971 <xsl:template match="ch.ocirc"><xsl:text>&#244;</xsl:text></xsl:template><!-- latin small letter o with circumflex, U+00F4 ISOlat1 -->
972 <xsl:template match="ch.otilde"><xsl:text>&#245;</xsl:text></xsl:template><!-- latin small letter o with tilde, U+00F5 ISOlat1 -->
973 <xsl:template match="ch.ouml"><xsl:text>&#246;</xsl:text></xsl:template><!-- latin small letter o with diaeresis, U+00F6 ISOlat1 -->
974 <xsl:template match="ch.divide"><xsl:text>&#247;</xsl:text></xsl:template><!-- division sign, U+00F7 ISOnum -->
975 <xsl:template match="ch.oslash"><xsl:text>&#248;</xsl:text></xsl:template><!-- latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1 -->
976 <xsl:template match="ch.ugrave"><xsl:text>&#249;</xsl:text></xsl:template><!-- latin small letter u with grave, U+00F9 ISOlat1 -->
977 <xsl:template match="ch.uacute"><xsl:text>&#250;</xsl:text></xsl:template><!-- latin small letter u with acute, U+00FA ISOlat1 -->
978 <xsl:template match="ch.ucirc"><xsl:text>&#251;</xsl:text></xsl:template><!-- latin small letter u with circumflex, U+00FB ISOlat1 -->
979 <xsl:template match="ch.uuml"><xsl:text>&#252;</xsl:text></xsl:template><!-- latin small letter u with diaeresis, U+00FC ISOlat1 -->
980 <xsl:template match="ch.yacute"><xsl:text>&#253;</xsl:text></xsl:template><!-- latin small letter y with acute, U+00FD ISOlat1 -->
981 <xsl:template match="ch.thorn"><xsl:text>&#254;</xsl:text></xsl:template><!-- latin small letter thorn, U+00FE ISOlat1 -->
982 <xsl:template match="ch.yuml"><xsl:text>&#255;</xsl:text></xsl:template><!-- latin small letter y with diaeresis, U+00FF ISOlat1 -->
983
984 <!-- ~~~~~~~~~~~~~~~~~~~~~ Special Characters ~~~~~~~~~~~~~~~~~~~~ -->
985
986 <xsl:template match="ch.ampersand">&amp;</xsl:template><!-- ampersand -->
987 <xsl:template match="ch.lsquot">&apos;</xsl:template><!-- opening left quotation mark -->
988 <xsl:template match="ch.rsquot">&apos;</xsl:template><!-- closing right quotation mark -->
989 <xsl:template match="ch.ldquot">&quot;</xsl:template><!-- opening left double quotation mark -->
990 <xsl:template match="ch.rdquot">&quot;</xsl:template><!-- closing right double quotation mark -->
991 <xsl:template match="ch.minus">-</xsl:template><!-- mathematical minus -->
992 <xsl:template match="ch.endash">-</xsl:template><!-- endash -->
993 <xsl:template match="ch.emdash">--</xsl:template><!-- emdash -->
994 <xsl:template match="ch.ellips">&nbsp;.&nbsp;.&nbsp;.</xsl:template><!-- ellipsis -->
995 <xsl:template match="ch.lellips">.&nbsp;.&nbsp;.&nbsp;</xsl:template><!-- left ellipsis, used at the beginning of edited material -->
996 <xsl:template match="ch.blankline">_______</xsl:template><!-- blank line to be filled in -->
997 <xsl:template match="ch.percent"><xsl:text>&#37;</xsl:text></xsl:template><!-- percent sign -->
998 <xsl:template match="ch.thinspace"><xsl:text></xsl:text></xsl:template><!-- small horizontal space for use between adjacent quotation marks - added mainly for LaTeX's sake -->
999 <xsl:template match="ch.frac116"><xsl:text>1/16</xsl:text></xsl:template><!-- vulgar fraction one sixteenth = fraction on sixteenth -->
1000 <xsl:template match="ch.plus"><xsl:text>+</xsl:text></xsl:template><!-- mathematical plus -->
1001
1002 <!-- ==================== named templates ======================= -->
1003
1004 <xsl:template name="xhtml-wrapper">
1005  <xsl:param name="document-type">undefined</xsl:param>
1006  <xsl:param name="filename">undefined</xsl:param>
1007  <xsl:param name="glossary-id-prefix"></xsl:param>
1008
1009 <!-- <redirect:write file="{$filename}.htm">-->
1010  <redirect:write file="{$filename}.htm">
1011   <xsl:fallback>
1012    <xsl:text>xhtml-wrapper: Cannot write to filename: "</xsl:text>
1013    <xsl:value-of select="$filename" /><xsl:text>.htm"</xsl:text>
1014   </xsl:fallback>
1015
1016   <html xml:lang="en-UK" lang="en-UK">
1017
1018    <xsl:value-of select="$newline" />
1019    <xsl:value-of select="$newline" />
1020
1021    <head><xsl:value-of select="$newline" />
1022     <title>
1023      <xsl:value-of select="/gamebook/meta/title[1]" />
1024      <xsl:text>: </xsl:text>
1025      <xsl:choose>
1026       <xsl:when test="$document-type='illustration'">
1027        <xsl:choose>
1028         <xsl:when test="$language='es'">
1029          <xsl:text>Ilustraci&oacute;n </xsl:text>
1030         </xsl:when>
1031         <xsl:otherwise>
1032          <xsl:text>Illustration </xsl:text>
1033         </xsl:otherwise>
1034        </xsl:choose>
1035        <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
1036       </xsl:when>
1037       <xsl:otherwise><xsl:value-of select="meta/title[1]" /></xsl:otherwise>
1038      </xsl:choose>
1039     </title><xsl:value-of select="$newline" />
1040     <meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" /><xsl:value-of select="$newline" />
1041     <meta name="robots" content="noindex,nofollow" /><xsl:value-of select="$newline" />
1042     <link rel="stylesheet" href="main.css" type="text/css" /><xsl:value-of select="$newline" />
1043    </head>
1044
1045    <xsl:value-of select="$newline" />
1046    <xsl:value-of select="$newline" />
1047
1048    <xsl:comment>
1049     <xsl:text> </xsl:text>
1050     <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
1051     <xsl:choose>
1052      <xsl:when test="$language='es'">
1053       <xsl:text> Publicado por </xsl:text>
1054      </xsl:when>
1055      <xsl:otherwise>
1056       <xsl:text> Published by </xsl:text>
1057      </xsl:otherwise>
1058     </xsl:choose>
1059     <xsl:apply-templates select="/gamebook/meta/publisher[1]" />
1060     <xsl:text>. </xsl:text>
1061    </xsl:comment>
1062
1063    <xsl:value-of select="$newline" />
1064    <xsl:value-of select="$newline" />
1065
1066    <body>
1067     <xsl:attribute name="text"><xsl:value-of select="$text-color" /></xsl:attribute>
1068     <xsl:attribute name="bgcolor"><xsl:value-of select="$background-color" /></xsl:attribute>
1069     <xsl:attribute name="background"><xsl:text>bckgrnd.gif</xsl:text></xsl:attribute>
1070     <xsl:attribute name="link"><xsl:value-of select="$link-color" /></xsl:attribute>
1071     <xsl:attribute name="alink"><xsl:value-of select="$alink-color" /></xsl:attribute>
1072     <xsl:attribute name="vlink"><xsl:value-of select="$vlink-color" /></xsl:attribute>
1073
1074     <xsl:value-of select="$newline" />
1075     <div id="title"><img src="title.gif" width="550" height="100" border="0" align="middle" usemap="#imagemap"><xsl:attribute name="alt"><xsl:value-of select="/gamebook/meta/title[1]" /></xsl:attribute></img></div><xsl:value-of select="$newline" />
1076     <div id="body"><xsl:value-of select="$newline" />
1077
1078      <xsl:choose>
1079
1080 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ top-level ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1081
1082       <xsl:when test="$document-type='top-level'">
1083        <div class="frontmatter"><xsl:value-of select="$newline" />
1084
1085         <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
1086         <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
1087
1088         <hr />
1089
1090         <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
1091
1092         <p>
1093          <xsl:choose>
1094           <xsl:when test="$language='es'">
1095            <xsl:text>Fecha de Publicaci&oacute;n: </xsl:text>
1096           </xsl:when>
1097           <xsl:otherwise>
1098            <xsl:text>Publication Date: </xsl:text>
1099           </xsl:otherwise>
1100          </xsl:choose>
1101          <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
1102          <xsl:text> </xsl:text>
1103          <xsl:choose>
1104           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
1105            <xsl:choose>
1106             <xsl:when test="$language='es'"><xsl:text>enero</xsl:text></xsl:when>
1107             <xsl:otherwise><xsl:text>January</xsl:text></xsl:otherwise>
1108            </xsl:choose>
1109           </xsl:when>
1110           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
1111            <xsl:choose>
1112             <xsl:when test="$language='es'"><xsl:text>febrero</xsl:text></xsl:when>
1113             <xsl:otherwise><xsl:text>February</xsl:text></xsl:otherwise>
1114            </xsl:choose>
1115           </xsl:when>
1116           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
1117            <xsl:choose>
1118             <xsl:when test="$language='es'"><xsl:text>marzo</xsl:text></xsl:when>
1119             <xsl:otherwise><xsl:text>March</xsl:text></xsl:otherwise>
1120            </xsl:choose>
1121           </xsl:when>
1122           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
1123            <xsl:choose>
1124             <xsl:when test="$language='es'"><xsl:text>abril</xsl:text></xsl:when>
1125             <xsl:otherwise><xsl:text>April</xsl:text></xsl:otherwise>
1126            </xsl:choose>
1127           </xsl:when>
1128           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
1129            <xsl:choose>
1130             <xsl:when test="$language='es'"><xsl:text>mayo</xsl:text></xsl:when>
1131             <xsl:otherwise><xsl:text>May</xsl:text></xsl:otherwise>
1132            </xsl:choose>
1133           </xsl:when>
1134           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
1135            <xsl:choose>
1136             <xsl:when test="$language='es'"><xsl:text>junio</xsl:text></xsl:when>
1137             <xsl:otherwise><xsl:text>June</xsl:text></xsl:otherwise>
1138            </xsl:choose>
1139           </xsl:when>
1140           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
1141            <xsl:choose>
1142             <xsl:when test="$language='es'"><xsl:text>julio</xsl:text></xsl:when>
1143             <xsl:otherwise><xsl:text>July</xsl:text></xsl:otherwise>
1144            </xsl:choose>
1145           </xsl:when>
1146           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
1147            <xsl:choose>
1148             <xsl:when test="$language='es'"><xsl:text>agosto</xsl:text></xsl:when>
1149             <xsl:otherwise><xsl:text>August</xsl:text></xsl:otherwise>
1150            </xsl:choose>
1151           </xsl:when>
1152           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
1153            <xsl:choose>
1154             <xsl:when test="$language='es'"><xsl:text>septiembre</xsl:text></xsl:when>
1155             <xsl:otherwise><xsl:text>September</xsl:text></xsl:otherwise>
1156            </xsl:choose>
1157           </xsl:when>
1158           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
1159            <xsl:choose>
1160             <xsl:when test="$language='es'"><xsl:text>octubre</xsl:text></xsl:when>
1161             <xsl:otherwise><xsl:text>October</xsl:text></xsl:otherwise>
1162            </xsl:choose>
1163           </xsl:when>
1164           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
1165            <xsl:choose>
1166             <xsl:when test="$language='es'"><xsl:text>noviembre</xsl:text></xsl:when>
1167             <xsl:otherwise><xsl:text>November</xsl:text></xsl:otherwise>
1168            </xsl:choose>
1169           </xsl:when>
1170           <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
1171            <xsl:choose>
1172             <xsl:when test="$language='es'"><xsl:text>diciembre</xsl:text></xsl:when>
1173             <xsl:otherwise><xsl:text>December</xsl:text></xsl:otherwise>
1174            </xsl:choose>
1175           </xsl:when>
1176           <xsl:otherwise>
1177            <xsl:text>Invalid Month</xsl:text>
1178           </xsl:otherwise>
1179          </xsl:choose>
1180          <xsl:text> </xsl:text>
1181          <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
1182         </p>
1183
1184         <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
1185
1186         <xsl:value-of select="$newline" />
1187
1188         <xsl:call-template name="navigation-bar" />
1189
1190         <xsl:value-of select="$newline" />
1191        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1192
1193       </xsl:when>
1194
1195 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ toc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1196
1197       <xsl:when test="$document-type='toc'">
1198        <div class="frontmatter"><xsl:value-of select="$newline" />
1199         <h2>
1200          <xsl:choose>
1201           <xsl:when test="$language='es'">
1202            <xsl:text>&Iacute;ndice de Contenidos</xsl:text>
1203           </xsl:when>
1204           <xsl:otherwise>
1205            <xsl:text>Table of Contents</xsl:text>
1206           </xsl:otherwise>
1207          </xsl:choose>
1208         </h2><xsl:value-of select="$newline" />
1209
1210         <xsl:value-of select="$newline" />
1211         <xsl:value-of select="$newline" />
1212
1213         <ul><xsl:value-of select="$newline" />
1214          <xsl:variable name="title-page">
1215           <xsl:choose>
1216            <xsl:when test="$language='es'">
1217             <xsl:text>P&aacute;gina Principal</xsl:text>
1218            </xsl:when>
1219            <xsl:otherwise>
1220             <xsl:text>Title Page</xsl:text>
1221            </xsl:otherwise>
1222           </xsl:choose>
1223          </xsl:variable>
1224
1225          <li><a href="title.htm"><xsl:value-of select="$title-page"/></a></li><xsl:value-of select="$newline" />
1226          <xsl:for-each select="/gamebook/section/data/section">
1227           <li>
1228            <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1229             <xsl:value-of select="meta/title[1]" />
1230            </a>
1231            <xsl:if test="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
1232             <xsl:value-of select="$newline" />
1233             <ul><xsl:value-of select="$newline" />
1234              <xsl:for-each select="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
1235               <li>
1236                <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1237                 <xsl:value-of select ="meta/title[1]" />
1238                </a>
1239               </li><xsl:value-of select="$newline" />
1240              </xsl:for-each>
1241             </ul><xsl:value-of select="$newline" />
1242            </xsl:if>
1243           </li><xsl:value-of select="$newline" />
1244          </xsl:for-each>
1245         </ul><xsl:value-of select="$newline" />
1246
1247         <xsl:value-of select="$newline" />
1248         <xsl:value-of select="$newline" />
1249         <xsl:call-template name="navigation-bar" />
1250        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1251       </xsl:when>
1252
1253 <!-- ~~~~~~~~~~~~~~~~ second-level-frontmatter ~~~~~~~~~~~~~~~~~~~ -->
1254
1255       <xsl:when test="$document-type='second-level-frontmatter'">
1256        <div class="frontmatter"><xsl:value-of select="$newline" />
1257         <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1258
1259         <xsl:value-of select="$newline" />
1260
1261         <xsl:apply-templates />
1262
1263         <xsl:value-of select="$newline" />
1264
1265         <xsl:call-template name="navigation-bar" />
1266
1267        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1268       </xsl:when>
1269
1270 <!-- ~~~~~~~~~~~~~ third-level-frontmatter-separate ~~~~~~~~~~~~~~ -->
1271
1272       <xsl:when test="$document-type='third-level-frontmatter-separate'">
1273        <div class="frontmatter"><xsl:value-of select="$newline" />
1274         <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1275         <xsl:value-of select="$newline" />
1276
1277         <xsl:apply-templates />
1278
1279         <xsl:value-of select="$newline" />
1280
1281         <xsl:call-template name="navigation-bar" />
1282
1283        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1284       </xsl:when>
1285
1286 <!-- ~~~~~~~~~~~~~~~~ second-level-mainmatter ~~~~~~~~~~~~~~~~~~~ -->
1287
1288       <xsl:when test="$document-type='second-level-mainmatter'">
1289        <div class="mainmatter"><xsl:value-of select="$newline" />
1290         <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1291         <xsl:value-of select="$newline" />
1292
1293         <xsl:apply-templates />
1294
1295         <xsl:value-of select="$newline" />
1296
1297         <xsl:call-template name="navigation-bar" />
1298
1299        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1300       </xsl:when>
1301
1302 <!-- ~~~~~~~~~~~~~ third-level-mainmatter-separate ~~~~~~~~~~~~~~ -->
1303
1304       <xsl:when test="$document-type='third-level-mainmatter-separate'">
1305        <div class="mainmatter"><xsl:value-of select="$newline" />
1306         <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1307         <xsl:value-of select="$newline" />
1308
1309         <xsl:apply-templates />
1310
1311         <xsl:value-of select="$newline" />
1312
1313         <xsl:call-template name="navigation-bar" />
1314
1315        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1316       </xsl:when>
1317
1318 <!-- ~~~~~~~~~~~~~~~~ second-level-glossary ~~~~~~~~~~~~~~~~~~~ -->
1319
1320       <xsl:when test="$document-type='second-level-glossary'">
1321        <div class="mainmatter"><xsl:value-of select="$newline" />
1322         <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1323         <xsl:value-of select="$newline" />
1324
1325         <xsl:apply-templates />
1326
1327         <xsl:value-of select="$newline" />
1328
1329         <xsl:call-template name="alpha-bar">
1330          <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
1331         </xsl:call-template>
1332
1333         <xsl:call-template name="navigation-bar" />
1334
1335        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1336       </xsl:when>
1337
1338 <!-- ~~~~~~~~~~~~~ third-level-glossary-separate ~~~~~~~~~~~~~~ -->
1339
1340       <xsl:when test="$document-type='third-level-glossary-separate'">
1341        <div class="glossary"><xsl:value-of select="$newline" />
1342         <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1343         <xsl:call-template name="alpha-bar">
1344          <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
1345         </xsl:call-template>
1346
1347         <xsl:value-of select="$newline" />
1348
1349         <xsl:apply-templates />
1350
1351         <xsl:value-of select="$newline" />
1352
1353         <xsl:call-template name="navigation-bar" />
1354         <xsl:value-of select="$newline" />
1355        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1356       </xsl:when>
1357
1358 <!-- ~~~~~~~~~~~~~~~~~~ second-level-numbered ~~~~~~~~~~~~~~~~~~~~ -->
1359 <!--
1360
1361 The following automatically generated section list requires that the
1362 title of each section be a simple number.
1363
1364 -->
1365       <xsl:when test="$document-type='second-level-numbered'">
1366        <div class="numbered"><xsl:value-of select="$newline" />
1367         <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1368         <xsl:value-of select="$newline" />
1369
1370         <xsl:variable name="base-section-number" select="number( data/section[1]/meta/title ) - 1" />
1371         <p>
1372          <xsl:for-each select="data/section">
1373           <xsl:if test="position( ) mod 10 = 1">
1374            <b><a><xsl:attribute name="name"><xsl:value-of select="position( ) + $base-section-number" /></xsl:attribute>
1375             <xsl:value-of select="position( ) + $base-section-number" />
1376             <xsl:if test="not( position( ) = last( ) )">
1377              <xsl:text>-</xsl:text>
1378              <xsl:choose>
1379               <xsl:when test="position( ) + 9 &lt;= last( )">
1380                <xsl:value-of select="position( ) + 9 + $base-section-number" />
1381               </xsl:when>
1382               <xsl:otherwise>
1383                <xsl:value-of select="last( ) + $base-section-number" />
1384               </xsl:otherwise>
1385              </xsl:choose>
1386             </xsl:if>
1387            </a><xsl:text>: </xsl:text></b>
1388           </xsl:if>
1389           <a>
1390            <xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1391            <xsl:value-of select="meta/title" />
1392           </a>
1393           <xsl:choose>
1394            <xsl:when test="position( ) mod 10 = 0">
1395             <br /><xsl:value-of select="$newline" />
1396            </xsl:when>
1397            <xsl:otherwise>
1398             <xsl:text> </xsl:text>
1399            </xsl:otherwise>
1400           </xsl:choose>
1401          </xsl:for-each>
1402         </p>
1403
1404         <xsl:value-of select="$newline" />
1405         <xsl:value-of select="$newline" />
1406
1407         <xsl:call-template name="navigation-bar" />
1408         <xsl:value-of select="$newline" />
1409        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1410       </xsl:when>
1411
1412 <!-- ~~~~~~~~~~~~~~~~~~ third-level-numbered ~~~~~~~~~~~~~~~~~~~~~ -->
1413
1414       <xsl:when test="$document-type='third-level-numbered'">
1415        <div class="numbered"><xsl:value-of select="$newline" />
1416         <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1417         <xsl:value-of select="$newline" />
1418
1419         <xsl:apply-templates />
1420
1421         <xsl:value-of select="$newline" />
1422         <xsl:call-template name="navigation-bar" />
1423         <xsl:value-of select="$newline" />
1424        </div>
1425       </xsl:when>
1426
1427 <!-- ~~~~~~~~~~~~~~~~~ second-level-backmatter ~~~~~~~~~~~~~~~~~~~ -->
1428
1429       <xsl:when test="$document-type='second-level-backmatter'">
1430        <div class="frontmatter"><xsl:value-of select="$newline" />
1431         <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1432
1433         <xsl:value-of select="$newline" />
1434         <xsl:value-of select="$newline" />
1435
1436         <xsl:apply-templates />
1437
1438         <xsl:value-of select="$newline" />
1439
1440         <xsl:call-template name="navigation-bar" />
1441         <xsl:value-of select="$newline" />
1442        </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1443       </xsl:when>
1444
1445 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ map-adjusted ~~~~~~~~~~~~~~~~~~~~~~~~ -->
1446
1447       <xsl:when test="$document-type='map-adjusted'">
1448        <div class="frontmatter"><xsl:value-of select="$newline" />
1449         <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1450
1451         <xsl:value-of select="$newline" />
1452         <xsl:value-of select="$newline" />
1453
1454         <xsl:for-each select="data/* | data/text()">
1455          <xsl:variable name="map-illustration-alt-text">
1456           <xsl:choose>
1457            <xsl:when test="$language='es'">
1458             <xsl:text>mapa</xsl:text>
1459            </xsl:when>
1460            <xsl:otherwise>
1461             <xsl:text>map</xsl:text>
1462            </xsl:otherwise>
1463           </xsl:choose>
1464          </xsl:variable>
1465
1466          <xsl:choose>
1467           <xsl:when test="self::illustration and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1468            <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1469            <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1470            <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1471
1472            <xsl:variable name="illustration-width-adjusted"><xsl:number value="386" /></xsl:variable>
1473            <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height * $illustration-width-adjusted div $illustration-width" /></xsl:variable>
1474
1475            <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1476             <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1477              <tr><xsl:value-of select="$newline" />
1478               <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1479               <td><img src="brdrtp.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1480               <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1481              </tr><xsl:value-of select="$newline" />
1482              <tr><xsl:value-of select="$newline" />
1483               <td><img src="brdrl.gif" width="31" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1484               <td><a href="maplarge.htm"><img src="{$illustration-src}" width="{$illustration-width-adjusted}" height="{$illustration-height-adjusted}" align="middle" border="0" alt="[{$map-illustration-alt-text}]" /></a></td><xsl:value-of select="$newline" />
1485               <td><img src="brdrr.gif" width="33" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1486              </tr><xsl:value-of select="$newline" />
1487              <tr><xsl:value-of select="$newline" />
1488               <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1489               <td><img src="brdrbt.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1490               <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1491              </tr><xsl:value-of select="$newline" />
1492             </table><xsl:value-of select="$newline" />
1493             <br /><br />
1494            </div></div><xsl:value-of select="$newline" />
1495           </xsl:when>
1496           <xsl:otherwise>
1497            <xsl:apply-templates select="." />
1498           </xsl:otherwise>
1499          </xsl:choose>
1500         </xsl:for-each>
1501
1502         <xsl:value-of select="$newline" />
1503
1504         <xsl:call-template name="navigation-bar" />
1505         <xsl:value-of select="$newline" />
1506        </div>
1507       </xsl:when>
1508
1509 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1510
1511       <xsl:when test="$document-type='map'">
1512        <div class="frontmatter"><xsl:value-of select="$newline" />
1513         <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1514
1515         <xsl:value-of select="$newline" />
1516         <xsl:value-of select="$newline" />
1517
1518         <xsl:for-each select="data/* | data/text()">
1519          <xsl:variable name="map-illustration-alt-text">
1520           <xsl:choose>
1521            <xsl:when test="$language='es'">
1522             <xsl:text>mapa</xsl:text>
1523            </xsl:when>
1524            <xsl:otherwise>
1525             <xsl:text>map</xsl:text>
1526            </xsl:otherwise>
1527           </xsl:choose>
1528          </xsl:variable>
1529
1530          <xsl:choose>
1531           <xsl:when test="self::illustration and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1532            <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1533            <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1534            <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1535
1536            <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1537             <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1538              <tr><xsl:value-of select="$newline" />
1539               <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1540               <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1541               <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1542              </tr><xsl:value-of select="$newline" />
1543              <tr><xsl:value-of select="$newline" />
1544               <td><img src="brdrl.gif" width="31"  height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1545               <td><a href="map.htm"><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" align="middle" border="0" alt="[{$map-illustration-alt-text}]" /></a></td><xsl:value-of select="$newline" />
1546               <td><img src="brdrr.gif" width="33" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1547              </tr><xsl:value-of select="$newline" />
1548              <tr><xsl:value-of select="$newline" />
1549               <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1550               <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1551               <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1552              </tr><xsl:value-of select="$newline" />
1553             </table><br /><xsl:value-of select="$newline" />
1554            </div></div><xsl:value-of select="$newline" />
1555           </xsl:when>
1556           <xsl:otherwise>
1557            <xsl:apply-templates select="." />
1558           </xsl:otherwise>
1559          </xsl:choose>
1560         </xsl:for-each>
1561
1562         <xsl:value-of select="$newline" />
1563
1564         <xsl:call-template name="navigation-bar" />
1565         <xsl:value-of select="$newline" />
1566        </div>
1567       </xsl:when>
1568
1569 <!-- ~~~~~~~~~~~~~~~~~~~~~~ illustration ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1570
1571       <xsl:when test="$document-type='illustration'">
1572        <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1573        <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1574        <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1575
1576        <xsl:variable name="illustration-alt-text">
1577         <xsl:choose>
1578          <xsl:when test="$language='es'">
1579           <xsl:text>ilustraci&oacute;n</xsl:text>
1580          </xsl:when>
1581          <xsl:otherwise>
1582           <xsl:text>illustration</xsl:text>
1583          </xsl:otherwise>
1584         </xsl:choose>
1585        </xsl:variable>
1586
1587        <h3>
1588         <xsl:choose>
1589          <xsl:when test="$language='es'">
1590           <xsl:text>Ilustraci&oacute;n </xsl:text>
1591          </xsl:when>
1592          <xsl:otherwise>
1593           <xsl:text>Illustration </xsl:text>
1594          </xsl:otherwise>
1595         </xsl:choose>
1596         <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
1597        </h3><xsl:value-of select="$newline" />
1598
1599        <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1600         <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1601          <tr><xsl:value-of select="$newline" />
1602           <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1603           <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1604           <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1605          </tr><xsl:value-of select="$newline" />
1606          <tr><xsl:value-of select="$newline" />
1607           <td><img src="brdrl.gif" width="31" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1608           <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" align="middle" border="0" alt="[{$illustration-alt-text}]" /></td><xsl:value-of select="$newline" />
1609           <td><img src="brdrr.gif" width="33" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1610          </tr><xsl:value-of select="$newline" />
1611          <tr><xsl:value-of select="$newline" />
1612           <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1613           <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1614           <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1615          </tr><xsl:value-of select="$newline" />
1616         </table><br /><xsl:value-of select="$newline" />
1617        </div></div><xsl:value-of select="$newline" />
1618        <p class="caption"><strong><xsl:apply-templates select="meta/description" /></strong></p><xsl:value-of select="$newline" />
1619       </xsl:when>
1620
1621 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1622
1623       <xsl:otherwise>
1624        <xsl:message>
1625         <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1626         <xsl:value-of select="$document-type" />
1627         <xsl:text>".</xsl:text>
1628        </xsl:message>
1629        <p>
1630         <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1631         <xsl:value-of select="$document-type" />
1632         <xsl:text>".</xsl:text>
1633        </p>
1634       </xsl:otherwise>
1635
1636      </xsl:choose>
1637
1638 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1639
1640      <xsl:call-template name="process-footnotes" />
1641
1642      <p class="copyright"><xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" /></p><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1643
1644     </div><xsl:value-of select="$newline" />
1645
1646     <map name="imagemap" id="imagemap">
1647      <area shape="rect" coords="0,0,99,99" href="http://www.projectaon.org/" alt="Project Aon" target="_top" />
1648      <area shape="default" href="title.htm">
1649       <xsl:attribute name="alt"><xsl:value-of select="/gamebook/meta/title[1]" /></xsl:attribute>
1650      </area>
1651     </map>
1652
1653    </body>
1654
1655    <xsl:value-of select="$newline" />
1656    <xsl:value-of select="$newline" />
1657
1658   </html>
1659  </redirect:write>
1660
1661 </xsl:template>
1662
1663 <xsl:template name="process-footnotes">
1664  <xsl:if test="footnotes/footnote">
1665   <div id="footnotes"><xsl:value-of select="$newline" />
1666    <xsl:for-each select="footnotes/footnote">
1667     <xsl:variable name="footnote-idref" select="@idref" />
1668     <xsl:variable name="footnote-id" select="@id" />
1669     <xsl:variable name="footnote-marker"><xsl:number count="footnotes/footnote" from="/" level="any" format="1" /></xsl:variable>
1670
1671     <xsl:for-each select="*[1]">
1672      <p>
1673       <xsl:text>[</xsl:text>
1674        <a href="#{$footnote-idref}" name="{$footnote-id}"><xsl:value-of select="$footnote-marker" /></a>
1675       <xsl:text>] </xsl:text>
1676       <xsl:apply-templates select="child::* | child::text()" />
1677      </p>
1678     </xsl:for-each>
1679
1680     <xsl:for-each select="*[position() != 1]">
1681       <xsl:apply-templates select="." />
1682     </xsl:for-each>
1683    </xsl:for-each>
1684   </div><xsl:value-of select="$newline" />
1685  </xsl:if>
1686 </xsl:template>
1687
1688 <xsl:template name="navigation-bar">
1689  <xsl:variable name="table-of-contents">
1690   <xsl:choose>
1691    <xsl:when test="$language='es'">
1692     <xsl:text>&Iacute;ndice de Contenidos</xsl:text>
1693    </xsl:when>
1694    <xsl:otherwise>
1695     <xsl:text>Table of Contents</xsl:text>      
1696    </xsl:otherwise>
1697   </xsl:choose>
1698  </xsl:variable>
1699  <div class="navigation">
1700   <table cellspacing="0" cellpadding="0" border="0">
1701    <tr>
1702     <td>
1703      <xsl:choose>
1704       <xsl:when test="meta/link[@class='prev']">
1705        <a>
1706         <xsl:attribute name="href">
1707          <xsl:value-of select="meta/link[@class='prev']/@idref" />
1708          <xsl:text>.htm</xsl:text>
1709         </xsl:attribute>
1710         <img src="back.gif" width="150" height="30" border="0">
1711          <xsl:attribute name="alt">
1712           <xsl:value-of select="id( meta/link[@class='prev']/@idref )/meta/title" />
1713          </xsl:attribute>
1714         </img>
1715        </a>
1716       </xsl:when>
1717       <xsl:otherwise>
1718        <img src="left.gif" width="150" height="30" border="0" alt="" />
1719       </xsl:otherwise>
1720      </xsl:choose>
1721     </td>
1722     <td><a href="toc.htm"><img src="toc.gif" width="150" height="30" border="0" alt="{$table-of-contents}" /></a></td>
1723     <td>
1724      <xsl:choose>
1725       <xsl:when test="meta/link[@class='next']">
1726        <a>
1727         <xsl:attribute name="href">
1728          <xsl:value-of select="meta/link[@class='next']/@idref" />
1729          <xsl:text>.htm</xsl:text>
1730         </xsl:attribute>
1731         <img src="forward.gif" width="150" height="30" border="0">
1732          <xsl:attribute name="alt">
1733           <xsl:choose>
1734            <xsl:when test="meta/link[@class='next']/@idref = 'sect1'">
1735             <xsl:choose>
1736              <xsl:when test="$language='es'">
1737               <xsl:text>Secci&oacute;n 1</xsl:text>
1738              </xsl:when>
1739              <xsl:otherwise>
1740               <xsl:text>Section 1</xsl:text>
1741              </xsl:otherwise>
1742             </xsl:choose>
1743            </xsl:when>
1744            <xsl:otherwise>
1745             <xsl:value-of select="id( meta/link[@class='next']/@idref )/meta/title" />
1746            </xsl:otherwise>
1747           </xsl:choose>
1748          </xsl:attribute>
1749         </img>
1750        </a>
1751       </xsl:when>
1752       <xsl:otherwise>
1753        <img src="right.gif" width="150" height="30" border="0" alt="" />
1754       </xsl:otherwise>
1755      </xsl:choose>
1756     </td>
1757    </tr>
1758   </table>
1759  </div>
1760 </xsl:template>
1761
1762 <xsl:template name="alpha-bar">
1763  <xsl:param name="alpha-bar-id-prefix"></xsl:param>
1764
1765   <p class="navigation">[<a href="{$alpha-bar-id-prefix}a.htm">A</a>&nbsp;<a href="{$alpha-bar-id-prefix}b.htm">B</a>&nbsp;<a href="{$alpha-bar-id-prefix}c.htm">C</a>&nbsp;<a href="{$alpha-bar-id-prefix}d.htm">D</a>&nbsp;<a href="{$alpha-bar-id-prefix}e.htm">E</a>&nbsp;<a href="{$alpha-bar-id-prefix}f.htm">F</a>&nbsp;<a href="{$alpha-bar-id-prefix}g.htm">G</a>&nbsp;<a href="{$alpha-bar-id-prefix}h.htm">H</a>&nbsp;<a href="{$alpha-bar-id-prefix}i.htm">I</a>&nbsp;<a href="{$alpha-bar-id-prefix}j.htm">J</a>&nbsp;<a href="{$alpha-bar-id-prefix}k.htm">K</a>&nbsp;<a href="{$alpha-bar-id-prefix}l.htm">L</a>&nbsp;<a href="{$alpha-bar-id-prefix}m.htm">M</a>&nbsp;<a href="{$alpha-bar-id-prefix}n.htm">N</a>&nbsp;<a href="{$alpha-bar-id-prefix}o.htm">O</a>&nbsp;<a href="{$alpha-bar-id-prefix}p.htm">P</a>&nbsp;<a href="{$alpha-bar-id-prefix}q.htm">Q</a>&nbsp;<a href="{$alpha-bar-id-prefix}r.htm">R</a>&nbsp;<a href="{$alpha-bar-id-prefix}s.htm">S</a>&nbsp;<a href="{$alpha-bar-id-prefix}t.htm">T</a>&nbsp;<a href="{$alpha-bar-id-prefix}u.htm">U</a>&nbsp;<a href="{$alpha-bar-id-prefix}v.htm">V</a>&nbsp;<a href="{$alpha-bar-id-prefix}w.htm">W</a>&nbsp;<a href="{$alpha-bar-id-prefix}x.htm">X</a>&nbsp;<a href="{$alpha-bar-id-prefix}y.htm">Y</a>&nbsp;<a href="{$alpha-bar-id-prefix}z.htm">Z</a>]</p><xsl:value-of select="$newline" />
1766
1767 </xsl:template>
1768
1769 </xsl:transform>