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