2 <!DOCTYPE xsl:transform [
3 <!ENTITY % xhtml.characters SYSTEM "../../en/xml/htmlchar.mod">
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.
15 Revision 1.5 2006/03/02 00:33:32 jonathan.blake
16 Removed the 'book-path' parameter to work with new gbtoxhtml.pl
18 Revision 1.4 2005/12/27 01:51:29 angantyr
19 Added templates for the "bookref" and "footref" elements.
21 Revision 1.3 2005/12/05 21:29:04 jonathan.blake
22 Added the facilities to properly handle character elements.
24 Revision 1.2 2005/04/09 19:51:50 angantyr
25 Added handling of open-ended quotes.
27 Revision 1.1 2005/01/30 01:32:52 jonathan.blake
28 Initial freepository revision of XML support documents.
30 Revision 1.12 2003/10/07 06:05:14 Jon
31 Added capability for "accent" illustrations.
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
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?
42 Revision 1.9 2002/11/17 05:06:56 jblake
43 Rearranged the title page.
45 Revision 1.8 2002/11/15 19:35:25 jblake
46 Fixed "Content-type" of XHTML output.
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.
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.
56 Revision 1.5 2002/10/24 15:53:41 jblake
57 Fixed a conflict with whitespace and paragraphed lists.
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.
63 Also reinstated the comment in each document since the new
64 version of Xalan redirects it properly.
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.
70 Revision 1.2 2002/10/20 06:25:35 jblake
71 Added support for CLOSE COMBAT SKILL for Freeway Warrior books.
73 Revision 1.1 2002/10/15 23:29:51 jblake
77 20020327 - repurposed to be used with Xalan Java 2
81 * Add blank whitespace handling to the paragraphed list template
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">
92 <xsl:output method="xml"
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" />
98 <xsl:strip-space elements="section data ol ul dl li dd footnotes footnote" />
99 <xsl:preserve-space elements="p choice" />
101 <!-- ====================== parameters ========================== -->
103 <xsl:param name="use-illustrators" />
104 <xsl:param name="language"><xsl:text>en</xsl:text></xsl:param>
106 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ colors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
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>
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>
115 <!-- ======================= variables ========================== -->
117 <xsl:variable name="newline">
122 <!-- ======================== Templates ========================= -->
124 <!-- ================= hierarchical sections ==================== -->
126 <xsl:template match="meta" />
127 <xsl:template match="section" />
129 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
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>
137 <xsl:apply-templates />
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>
146 <xsl:apply-templates />
149 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
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>
158 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
160 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
161 <h3><xsl:value-of select="meta/title[1]" /></h3>
163 <xsl:value-of select="$newline" />
164 <xsl:value-of select="$newline" />
166 <xsl:apply-templates />
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>
176 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
178 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
179 <h4><xsl:value-of select="meta/title[1]" /></h4>
181 <xsl:value-of select="$newline" />
182 <xsl:value-of select="$newline" />
184 <xsl:apply-templates />
187 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
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>
192 <xsl:value-of select="$newline" />
193 <xsl:value-of select="$newline" />
195 <xsl:apply-templates />
198 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
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>
207 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
209 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
210 <h3><xsl:value-of select="meta/title[1]" /></h3>
212 <xsl:value-of select="$newline" />
213 <xsl:value-of select="$newline" />
215 <xsl:apply-templates />
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>
225 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
227 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
228 <h4><xsl:value-of select="meta/title[1]" /></h4>
230 <xsl:value-of select="$newline" />
231 <xsl:value-of select="$newline" />
233 <xsl:apply-templates />
236 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
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>
241 <xsl:value-of select="$newline" />
242 <xsl:value-of select="$newline" />
244 <xsl:apply-templates />
247 <!-- :::::::::::: second-level glossary sections ::::::::::::: -->
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>
257 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
258 <!-- glossary sections should be enclosed in a second level glossary section -->
260 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary']">
261 <h3><xsl:value-of select="meta/title[1]" /></h3>
263 <xsl:value-of select="$newline" />
264 <xsl:value-of select="$newline" />
266 <xsl:apply-templates />
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>
277 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
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>
285 <xsl:apply-templates />
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>
295 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
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>
304 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
306 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
307 <h3><xsl:value-of select="meta/title[1]" /></h3>
309 <xsl:value-of select="$newline" />
310 <xsl:value-of select="$newline" />
312 <xsl:apply-templates />
315 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
317 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
318 <h4><xsl:value-of select="meta/title[1]" /></h4>
320 <xsl:value-of select="$newline" />
321 <xsl:value-of select="$newline" />
323 <xsl:apply-templates />
326 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
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>
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>
340 <!-- ==================== block elements ======================== -->
342 <xsl:template match="p">
343 <p><xsl:apply-templates /></p>
344 <xsl:value-of select="$newline" />
347 <xsl:template match="p[@class='dedication']">
348 <p class="dedication"><xsl:apply-templates /></p>
349 <xsl:value-of select="$newline" />
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">
355 <xsl:when test="$language='es'">
356 <xsl:text>ilustración</xsl:text>
359 <xsl:text>illustration</xsl:text>
365 <xsl:when test="self::p">
366 <xsl:apply-templates /><br /><br /><xsl:value-of select="$newline" />
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" />
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" />
378 <xsl:when test="self::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" />
385 <xsl:when test="self::blockquote">
386 <blockquote><xsl:value-of select="$newline" />
387 <xsl:apply-templates />
388 </blockquote><xsl:value-of select="$newline" />
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" />
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" />
418 <xsl:text>[error: paragraphed list template]</xsl:text>
423 <xsl:template match="ol">
424 <ol><xsl:value-of select="$newline" />
425 <xsl:apply-templates />
426 </ol><xsl:value-of select="$newline" />
429 <xsl:template match="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" />
437 <xsl:template match="dl">
438 <dl><xsl:value-of select="$newline" />
439 <xsl:apply-templates />
440 </dl><xsl:value-of select="$newline" />
443 <xsl:template match="dt">
444 <dt><xsl:apply-templates /></dt>
445 <xsl:value-of select="$newline" />
448 <xsl:template match="dd">
449 <dd><xsl:apply-templates /></dd>
450 <xsl:value-of select="$newline" />
453 <xsl:template match="li">
454 <li><xsl:apply-templates /></li>
455 <xsl:value-of select="$newline" />
458 <xsl:template match="table">
459 <table border="1" cellspacing="0" cellpadding="2">
460 <xsl:apply-templates />
462 <xsl:value-of select="$newline" />
465 <xsl:template match="tr">
467 <xsl:apply-templates />
471 <xsl:template match="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 />
480 <xsl:template match="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 />
489 <xsl:template match="combat">
491 <xsl:apply-templates select="enemy" />
492 <xsl:text>: </xsl:text>
494 <xsl:when test="enemy-attribute[@class='combatskill']">
495 <span class="smallcaps">
497 <xsl:when test="$language='es'">
498 <xsl:text>DESTREZA EN EL COMBATE</xsl:text>
501 <xsl:text>COMBAT SKILL</xsl:text>
505 <xsl:text> </xsl:text>
506 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
508 <xsl:when test="enemy-attribute[@class='closecombatskill']">
509 <span class="smallcaps">
511 <xsl:when test="$language='es'">
512 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
515 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
519 <xsl:text> </xsl:text>
520 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
523 <xsl:text> </xsl:text>
524 <span class="smallcaps">
526 <xsl:when test="$language='es'">
527 <xsl:text>RESISTENCIA</xsl:text>
530 <xsl:text>ENDURANCE</xsl:text>
535 <xsl:when test="enemy-attribute[@class='target']">
537 <xsl:when test="$language='es'">
538 <xsl:text> (o </xsl:text><span class="smallcaps">BLANCOS</span><xsl:text>)</xsl:text>
541 <xsl:text> (</xsl:text><span class="smallcaps">TARGET</span><xsl:text> points)</xsl:text>
544 <xsl:text> </xsl:text>
545 <xsl:value-of select="enemy-attribute[@class='target']" />
547 <xsl:when test="enemy-attribute[@class='resistance']">
549 <xsl:when test="$language='es'"></xsl:when>
551 <xsl:text> (</xsl:text><span class="smallcaps">RESISTANCE</span><xsl:text> points)</xsl:text>
554 <xsl:text> </xsl:text>
555 <xsl:value-of select="enemy-attribute[@class='resistance']" />
558 <xsl:text> </xsl:text>
559 <xsl:value-of select="enemy-attribute[@class='endurance']" />
563 <xsl:value-of select="$newline" />
566 <xsl:template match="choice">
567 <xsl:variable name="link">
568 <xsl:value-of select="@idref" />
572 <xsl:for-each select="* | text()">
574 <xsl:when test="self::link-text">
575 <a href="{$link}.htm">
576 <xsl:apply-templates />
580 <xsl:apply-templates select="." />
585 <xsl:value-of select="$newline" />
588 <xsl:template match="signpost">
589 <div class="signpost">
590 <xsl:apply-templates />
592 <xsl:value-of select="$newline" />
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" />
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" />
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>
609 <xsl:variable name="illustration-alt-text">
611 <xsl:when test="$language='es'">
612 <xsl:text>ilustración</xsl:text>
615 <xsl:text>illustration</xsl:text>
620 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
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" />
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}]" />
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" />
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>
654 <xsl:when test="@class='accent'" />
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" />
682 <xsl:template match="instance" />
684 <xsl:template match="footnotes" />
686 <xsl:template match="footnote" />
688 <xsl:template match="hr">
690 <xsl:value-of select="$newline" />
693 <!-- ==================== inline elements ======================= -->
695 <xsl:template match="a">
697 <xsl:when test="@href">
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 />
706 <xsl:if test="@idref">
707 <xsl:variable name="my-idref" select="@idref" />
708 <xsl:attribute name="href">
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>
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>
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>
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>
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>
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" />
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" />
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" />
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" />
739 <xsl:text>[error: a template]</xsl:text>
744 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
745 <xsl:apply-templates />
751 <!-- This template is obsolete, the "footref" element should be used instead -->
752 <xsl:template match="a[@class='footnote']">
753 <xsl:apply-templates />
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" />
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" />
774 <xsl:template match="bookref">
776 <xsl:attribute name="href">
777 <xsl:variable name="my-section">
779 <xsl:when test="@section">
780 <xsl:value-of select="@section" />
783 <xsl:text>title</xsl:text>
787 <xsl:variable name="my-series">
788 <!-- If series is specified, go one directory back and then to series. Otherwise, add nothing. -->
790 <xsl:when test="@series">
791 <xsl:text>/../</xsl:text><xsl:value-of select="@series" />
794 <xsl:text></xsl:text>
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>
800 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
801 <xsl:apply-templates />
805 <xsl:template match="footref">
806 <xsl:apply-templates />
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" />
816 <xsl:template match="em">
817 <em><xsl:apply-templates /></em>
820 <xsl:template match="strong">
821 <strong><xsl:apply-templates /></strong>
824 <xsl:template match="thought">
825 <i><xsl:apply-templates /></i>
828 <xsl:template match="onomatopoeia">
829 <i><xsl:apply-templates /></i>
832 <xsl:template match="spell">
833 <i><xsl:apply-templates /></i>
836 <xsl:template match="item">
837 <xsl:apply-templates />
840 <xsl:template match="foreign">
841 <i><xsl:apply-templates /></i>
844 <xsl:template match="quote">
845 <xsl:text>'</xsl:text>
846 <xsl:apply-templates />
847 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>'</xsl:text></xsl:if>
850 <xsl:template match="quote//quote">
851 <xsl:text>"</xsl:text>
852 <xsl:apply-templates />
853 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>"</xsl:text></xsl:if>
856 <xsl:template match="cite">
857 <cite><xsl:apply-templates /></cite>
860 <xsl:template match="code">
861 <tt><xsl:apply-templates /></tt>
864 <xsl:template match="br">
868 <xsl:template match="typ[@class='attribute']">
869 <span class="smallcaps"><xsl:apply-templates /></span>
872 <!-- ==================== character elements ==================== -->
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
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.
886 <xsl:template match="ch.apos"><xsl:text>'</xsl:text></xsl:template><!-- apostrophe = single quotation mark -->
887 <xsl:template match="ch.nbsp"><xsl:text> </xsl:text></xsl:template><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
888 <xsl:template match="ch.iexcl"><xsl:text>¡</xsl:text></xsl:template><!-- inverted exclamation mark, U+00A1 ISOnum -->
889 <xsl:template match="ch.cent"><xsl:text>¢</xsl:text></xsl:template><!-- cent sign, U+00A2 ISOnum -->
890 <xsl:template match="ch.pound"><xsl:text>£</xsl:text></xsl:template><!-- pound sign, U+00A3 ISOnum -->
891 <xsl:template match="ch.curren"><xsl:text>¤</xsl:text></xsl:template><!-- currency sign, U+00A4 ISOnum -->
892 <xsl:template match="ch.yen"><xsl:text>¥</xsl:text></xsl:template><!-- yen sign = yuan sign, U+00A5 ISOnum -->
893 <xsl:template match="ch.brvbar"><xsl:text>¦</xsl:text></xsl:template><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
894 <xsl:template match="ch.sect"><xsl:text>§</xsl:text></xsl:template><!-- section sign, U+00A7 ISOnum -->
895 <xsl:template match="ch.uml"><xsl:text>¨</xsl:text></xsl:template><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
896 <xsl:template match="ch.copy"><xsl:text>©</xsl:text></xsl:template><!-- copyright sign, U+00A9 ISOnum -->
897 <xsl:template match="ch.ordf"><xsl:text>ª</xsl:text></xsl:template><!-- feminine ordinal indicator, U+00AA ISOnum -->
898 <xsl:template match="ch.laquo"><xsl:text>«</xsl:text></xsl:template><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
899 <xsl:template match="ch.not"><xsl:text>¬</xsl:text></xsl:template><!-- not sign, U+00AC ISOnum -->
900 <xsl:template match="ch.shy"><xsl:text>­</xsl:text></xsl:template><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
901 <xsl:template match="ch.reg"><xsl:text>®</xsl:text></xsl:template><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
902 <xsl:template match="ch.macr"><xsl:text>¯</xsl:text></xsl:template><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
903 <xsl:template match="ch.deg"><xsl:text>°</xsl:text></xsl:template><!-- degree sign, U+00B0 ISOnum -->
904 <xsl:template match="ch.plusmn"><xsl:text>±</xsl:text></xsl:template><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
905 <xsl:template match="ch.sup2"><xsl:text>²</xsl:text></xsl:template><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
906 <xsl:template match="ch.sup3"><xsl:text>³</xsl:text></xsl:template><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
907 <xsl:template match="ch.acute"><xsl:text>´</xsl:text></xsl:template><!-- acute accent = spacing acute, U+00B4 ISOdia -->
908 <xsl:template match="ch.micro"><xsl:text>µ</xsl:text></xsl:template><!-- micro sign, U+00B5 ISOnum -->
909 <xsl:template match="ch.para"><xsl:text>¶</xsl:text></xsl:template><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
910 <xsl:template match="ch.middot"><xsl:text>·</xsl:text></xsl:template><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
911 <xsl:template match="ch.cedil"><xsl:text>¸</xsl:text></xsl:template><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
912 <xsl:template match="ch.sup1"><xsl:text>¹</xsl:text></xsl:template><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
913 <xsl:template match="ch.ordm"><xsl:text>º</xsl:text></xsl:template><!-- masculine ordinal indicator, U+00BA ISOnum -->
914 <xsl:template match="ch.raquo"><xsl:text>»</xsl:text></xsl:template><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
915 <xsl:template match="ch.frac14"><xsl:text>¼</xsl:text></xsl:template><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
916 <xsl:template match="ch.frac12"><xsl:text>½</xsl:text></xsl:template><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
917 <xsl:template match="ch.frac34"><xsl:text>¾</xsl:text></xsl:template><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
918 <xsl:template match="ch.iquest"><xsl:text>¿</xsl:text></xsl:template><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
919 <xsl:template match="ch.Agrave"><xsl:text>À</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>Á</xsl:text></xsl:template><!-- latin capital letter A with acute, U+00C1 ISOlat1 -->
921 <xsl:template match="ch.Acirc"><xsl:text>Â</xsl:text></xsl:template><!-- latin capital letter A with circumflex, U+00C2 ISOlat1 -->
922 <xsl:template match="ch.Atilde"><xsl:text>Ã</xsl:text></xsl:template><!-- latin capital letter A with tilde, U+00C3 ISOlat1 -->
923 <xsl:template match="ch.Auml"><xsl:text>Ä</xsl:text></xsl:template><!-- latin capital letter A with diaeresis, U+00C4 ISOlat1 -->
924 <xsl:template match="ch.Aring"><xsl:text>Å</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>Æ</xsl:text></xsl:template><!-- latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 -->
926 <xsl:template match="ch.Ccedil"><xsl:text>Ç</xsl:text></xsl:template><!-- latin capital letter C with cedilla, U+00C7 ISOlat1 -->
927 <xsl:template match="ch.Egrave"><xsl:text>È</xsl:text></xsl:template><!-- latin capital letter E with grave, U+00C8 ISOlat1 -->
928 <xsl:template match="ch.Eacute"><xsl:text>É</xsl:text></xsl:template><!-- latin capital letter E with acute, U+00C9 ISOlat1 -->
929 <xsl:template match="ch.Ecirc"><xsl:text>Ê</xsl:text></xsl:template><!-- latin capital letter E with circumflex, U+00CA ISOlat1 -->
930 <xsl:template match="ch.Euml"><xsl:text>Ë</xsl:text></xsl:template><!-- latin capital letter E with diaeresis, U+00CB ISOlat1 -->
931 <xsl:template match="ch.Igrave"><xsl:text>Ì</xsl:text></xsl:template><!-- latin capital letter I with grave, U+00CC ISOlat1 -->
932 <xsl:template match="ch.Iacute"><xsl:text>Í</xsl:text></xsl:template><!-- latin capital letter I with acute, U+00CD ISOlat1 -->
933 <xsl:template match="ch.Icirc"><xsl:text>Î</xsl:text></xsl:template><!-- latin capital letter I with circumflex, U+00CE ISOlat1 -->
934 <xsl:template match="ch.Iuml"><xsl:text>Ï</xsl:text></xsl:template><!-- latin capital letter I with diaeresis, U+00CF ISOlat1 -->
935 <xsl:template match="ch.ETH"><xsl:text>Ð</xsl:text></xsl:template><!-- latin capital letter ETH, U+00D0 ISOlat1 -->
936 <xsl:template match="ch.Ntilde"><xsl:text>Ñ</xsl:text></xsl:template><!-- latin capital letter N with tilde, U+00D1 ISOlat1 -->
937 <xsl:template match="ch.Ograve"><xsl:text>Ò</xsl:text></xsl:template><!-- latin capital letter O with grave, U+00D2 ISOlat1 -->
938 <xsl:template match="ch.Oacute"><xsl:text>Ó</xsl:text></xsl:template><!-- latin capital letter O with acute, U+00D3 ISOlat1 -->
939 <xsl:template match="ch.Ocirc"><xsl:text>Ô</xsl:text></xsl:template><!-- latin capital letter O with circumflex, U+00D4 ISOlat1 -->
940 <xsl:template match="ch.Otilde"><xsl:text>Õ</xsl:text></xsl:template><!-- latin capital letter O with tilde, U+00D5 ISOlat1 -->
941 <xsl:template match="ch.Ouml"><xsl:text>Ö</xsl:text></xsl:template><!-- latin capital letter O with diaeresis, U+00D6 ISOlat1 -->
942 <xsl:template match="ch.times"><xsl:text>×</xsl:text></xsl:template><!-- multiplication sign, U+00D7 ISOnum -->
943 <xsl:template match="ch.Oslash"><xsl:text>Ø</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>Ù</xsl:text></xsl:template><!-- latin capital letter U with grave, U+00D9 ISOlat1 -->
945 <xsl:template match="ch.Uacute"><xsl:text>Ú</xsl:text></xsl:template><!-- latin capital letter U with acute, U+00DA ISOlat1 -->
946 <xsl:template match="ch.Ucirc"><xsl:text>Û</xsl:text></xsl:template><!-- latin capital letter U with circumflex, U+00DB ISOlat1 -->
947 <xsl:template match="ch.Uuml"><xsl:text>Ü</xsl:text></xsl:template><!-- latin capital letter U with diaeresis, U+00DC ISOlat1 -->
948 <xsl:template match="ch.Yacute"><xsl:text>Ý</xsl:text></xsl:template><!-- latin capital letter Y with acute, U+00DD ISOlat1 -->
949 <xsl:template match="ch.THORN"><xsl:text>Þ</xsl:text></xsl:template><!-- latin capital letter THORN, U+00DE ISOlat1 -->
950 <xsl:template match="ch.szlig"><xsl:text>ß</xsl:text></xsl:template><!-- latin small letter sharp s = ess-zed, U+00DF ISOlat1 -->
951 <xsl:template match="ch.agrave"><xsl:text>à</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>á</xsl:text></xsl:template><!-- latin small letter a with acute, U+00E1 ISOlat1 -->
953 <xsl:template match="ch.acirc"><xsl:text>â</xsl:text></xsl:template><!-- latin small letter a with circumflex, U+00E2 ISOlat1 -->
954 <xsl:template match="ch.atilde"><xsl:text>ã</xsl:text></xsl:template><!-- latin small letter a with tilde, U+00E3 ISOlat1 -->
955 <xsl:template match="ch.auml"><xsl:text>ä</xsl:text></xsl:template><!-- latin small letter a with diaeresis, U+00E4 ISOlat1 -->
956 <xsl:template match="ch.aring"><xsl:text>å</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>æ</xsl:text></xsl:template><!-- latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 -->
958 <xsl:template match="ch.ccedil"><xsl:text>ç</xsl:text></xsl:template><!-- latin small letter c with cedilla, U+00E7 ISOlat1 -->
959 <xsl:template match="ch.egrave"><xsl:text>è</xsl:text></xsl:template><!-- latin small letter e with grave, U+00E8 ISOlat1 -->
960 <xsl:template match="ch.eacute"><xsl:text>é</xsl:text></xsl:template><!-- latin small letter e with acute, U+00E9 ISOlat1 -->
961 <xsl:template match="ch.ecirc"><xsl:text>ê</xsl:text></xsl:template><!-- latin small letter e with circumflex, U+00EA ISOlat1 -->
962 <xsl:template match="ch.euml"><xsl:text>ë</xsl:text></xsl:template><!-- latin small letter e with diaeresis, U+00EB ISOlat1 -->
963 <xsl:template match="ch.igrave"><xsl:text>ì</xsl:text></xsl:template><!-- latin small letter i with grave, U+00EC ISOlat1 -->
964 <xsl:template match="ch.iacute"><xsl:text>í</xsl:text></xsl:template><!-- latin small letter i with acute, U+00ED ISOlat1 -->
965 <xsl:template match="ch.icirc"><xsl:text>î</xsl:text></xsl:template><!-- latin small letter i with circumflex, U+00EE ISOlat1 -->
966 <xsl:template match="ch.iuml"><xsl:text>ï</xsl:text></xsl:template><!-- latin small letter i with diaeresis, U+00EF ISOlat1 -->
967 <xsl:template match="ch.eth"><xsl:text>ð</xsl:text></xsl:template><!-- latin small letter eth, U+00F0 ISOlat1 -->
968 <xsl:template match="ch.ntilde"><xsl:text>ñ</xsl:text></xsl:template><!-- latin small letter n with tilde, U+00F1 ISOlat1 -->
969 <xsl:template match="ch.ograve"><xsl:text>ò</xsl:text></xsl:template><!-- latin small letter o with grave, U+00F2 ISOlat1 -->
970 <xsl:template match="ch.oacute"><xsl:text>ó</xsl:text></xsl:template><!-- latin small letter o with acute, U+00F3 ISOlat1 -->
971 <xsl:template match="ch.ocirc"><xsl:text>ô</xsl:text></xsl:template><!-- latin small letter o with circumflex, U+00F4 ISOlat1 -->
972 <xsl:template match="ch.otilde"><xsl:text>õ</xsl:text></xsl:template><!-- latin small letter o with tilde, U+00F5 ISOlat1 -->
973 <xsl:template match="ch.ouml"><xsl:text>ö</xsl:text></xsl:template><!-- latin small letter o with diaeresis, U+00F6 ISOlat1 -->
974 <xsl:template match="ch.divide"><xsl:text>÷</xsl:text></xsl:template><!-- division sign, U+00F7 ISOnum -->
975 <xsl:template match="ch.oslash"><xsl:text>ø</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>ù</xsl:text></xsl:template><!-- latin small letter u with grave, U+00F9 ISOlat1 -->
977 <xsl:template match="ch.uacute"><xsl:text>ú</xsl:text></xsl:template><!-- latin small letter u with acute, U+00FA ISOlat1 -->
978 <xsl:template match="ch.ucirc"><xsl:text>û</xsl:text></xsl:template><!-- latin small letter u with circumflex, U+00FB ISOlat1 -->
979 <xsl:template match="ch.uuml"><xsl:text>ü</xsl:text></xsl:template><!-- latin small letter u with diaeresis, U+00FC ISOlat1 -->
980 <xsl:template match="ch.yacute"><xsl:text>ý</xsl:text></xsl:template><!-- latin small letter y with acute, U+00FD ISOlat1 -->
981 <xsl:template match="ch.thorn"><xsl:text>þ</xsl:text></xsl:template><!-- latin small letter thorn, U+00FE ISOlat1 -->
982 <xsl:template match="ch.yuml"><xsl:text>ÿ</xsl:text></xsl:template><!-- latin small letter y with diaeresis, U+00FF ISOlat1 -->
984 <!-- ~~~~~~~~~~~~~~~~~~~~~ Special Characters ~~~~~~~~~~~~~~~~~~~~ -->
986 <xsl:template match="ch.ampersand">&</xsl:template><!-- ampersand -->
987 <xsl:template match="ch.lsquot">'</xsl:template><!-- opening left quotation mark -->
988 <xsl:template match="ch.rsquot">'</xsl:template><!-- closing right quotation mark -->
989 <xsl:template match="ch.ldquot">"</xsl:template><!-- opening left double quotation mark -->
990 <xsl:template match="ch.rdquot">"</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"> . . .</xsl:template><!-- ellipsis -->
995 <xsl:template match="ch.lellips">. . . </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>%</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 -->
1002 <!-- ==================== named templates ======================= -->
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>
1009 <!-- <redirect:write file="{$filename}.htm">-->
1010 <redirect:write file="{$filename}.htm">
1012 <xsl:text>xhtml-wrapper: Cannot write to filename: "</xsl:text>
1013 <xsl:value-of select="$filename" /><xsl:text>.htm"</xsl:text>
1016 <html xml:lang="en-UK" lang="en-UK">
1018 <xsl:value-of select="$newline" />
1019 <xsl:value-of select="$newline" />
1021 <head><xsl:value-of select="$newline" />
1023 <xsl:value-of select="/gamebook/meta/title[1]" />
1024 <xsl:text>: </xsl:text>
1026 <xsl:when test="$document-type='illustration'">
1028 <xsl:when test="$language='es'">
1029 <xsl:text>Ilustración </xsl:text>
1032 <xsl:text>Illustration </xsl:text>
1035 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
1037 <xsl:otherwise><xsl:value-of select="meta/title[1]" /></xsl:otherwise>
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" />
1045 <xsl:value-of select="$newline" />
1046 <xsl:value-of select="$newline" />
1049 <xsl:text> </xsl:text>
1050 <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
1052 <xsl:when test="$language='es'">
1053 <xsl:text> Publicado por </xsl:text>
1056 <xsl:text> Published by </xsl:text>
1059 <xsl:apply-templates select="/gamebook/meta/publisher[1]" />
1060 <xsl:text>. </xsl:text>
1063 <xsl:value-of select="$newline" />
1064 <xsl:value-of select="$newline" />
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>
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" />
1080 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ top-level ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1082 <xsl:when test="$document-type='top-level'">
1083 <div class="frontmatter"><xsl:value-of select="$newline" />
1085 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
1086 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
1090 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
1094 <xsl:when test="$language='es'">
1095 <xsl:text>Fecha de Publicación: </xsl:text>
1098 <xsl:text>Publication Date: </xsl:text>
1101 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
1102 <xsl:text> </xsl:text>
1104 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
1106 <xsl:when test="$language='es'"><xsl:text>enero</xsl:text></xsl:when>
1107 <xsl:otherwise><xsl:text>January</xsl:text></xsl:otherwise>
1110 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
1112 <xsl:when test="$language='es'"><xsl:text>febrero</xsl:text></xsl:when>
1113 <xsl:otherwise><xsl:text>February</xsl:text></xsl:otherwise>
1116 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
1118 <xsl:when test="$language='es'"><xsl:text>marzo</xsl:text></xsl:when>
1119 <xsl:otherwise><xsl:text>March</xsl:text></xsl:otherwise>
1122 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
1124 <xsl:when test="$language='es'"><xsl:text>abril</xsl:text></xsl:when>
1125 <xsl:otherwise><xsl:text>April</xsl:text></xsl:otherwise>
1128 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
1130 <xsl:when test="$language='es'"><xsl:text>mayo</xsl:text></xsl:when>
1131 <xsl:otherwise><xsl:text>May</xsl:text></xsl:otherwise>
1134 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
1136 <xsl:when test="$language='es'"><xsl:text>junio</xsl:text></xsl:when>
1137 <xsl:otherwise><xsl:text>June</xsl:text></xsl:otherwise>
1140 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
1142 <xsl:when test="$language='es'"><xsl:text>julio</xsl:text></xsl:when>
1143 <xsl:otherwise><xsl:text>July</xsl:text></xsl:otherwise>
1146 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
1148 <xsl:when test="$language='es'"><xsl:text>agosto</xsl:text></xsl:when>
1149 <xsl:otherwise><xsl:text>August</xsl:text></xsl:otherwise>
1152 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
1154 <xsl:when test="$language='es'"><xsl:text>septiembre</xsl:text></xsl:when>
1155 <xsl:otherwise><xsl:text>September</xsl:text></xsl:otherwise>
1158 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
1160 <xsl:when test="$language='es'"><xsl:text>octubre</xsl:text></xsl:when>
1161 <xsl:otherwise><xsl:text>October</xsl:text></xsl:otherwise>
1164 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
1166 <xsl:when test="$language='es'"><xsl:text>noviembre</xsl:text></xsl:when>
1167 <xsl:otherwise><xsl:text>November</xsl:text></xsl:otherwise>
1170 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
1172 <xsl:when test="$language='es'"><xsl:text>diciembre</xsl:text></xsl:when>
1173 <xsl:otherwise><xsl:text>December</xsl:text></xsl:otherwise>
1177 <xsl:text>Invalid Month</xsl:text>
1180 <xsl:text> </xsl:text>
1181 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
1184 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
1186 <xsl:value-of select="$newline" />
1188 <xsl:call-template name="navigation-bar" />
1190 <xsl:value-of select="$newline" />
1191 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1195 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ toc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1197 <xsl:when test="$document-type='toc'">
1198 <div class="frontmatter"><xsl:value-of select="$newline" />
1201 <xsl:when test="$language='es'">
1202 <xsl:text>Índice de Contenidos</xsl:text>
1205 <xsl:text>Table of Contents</xsl:text>
1208 </h2><xsl:value-of select="$newline" />
1210 <xsl:value-of select="$newline" />
1211 <xsl:value-of select="$newline" />
1213 <ul><xsl:value-of select="$newline" />
1214 <xsl:variable name="title-page">
1216 <xsl:when test="$language='es'">
1217 <xsl:text>Página Principal</xsl:text>
1220 <xsl:text>Title Page</xsl:text>
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">
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]" />
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']">
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]" />
1239 </li><xsl:value-of select="$newline" />
1241 </ul><xsl:value-of select="$newline" />
1243 </li><xsl:value-of select="$newline" />
1245 </ul><xsl:value-of select="$newline" />
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" />
1253 <!-- ~~~~~~~~~~~~~~~~ second-level-frontmatter ~~~~~~~~~~~~~~~~~~~ -->
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" />
1259 <xsl:value-of select="$newline" />
1261 <xsl:apply-templates />
1263 <xsl:value-of select="$newline" />
1265 <xsl:call-template name="navigation-bar" />
1267 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1270 <!-- ~~~~~~~~~~~~~ third-level-frontmatter-separate ~~~~~~~~~~~~~~ -->
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" />
1277 <xsl:apply-templates />
1279 <xsl:value-of select="$newline" />
1281 <xsl:call-template name="navigation-bar" />
1283 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1286 <!-- ~~~~~~~~~~~~~~~~ second-level-mainmatter ~~~~~~~~~~~~~~~~~~~ -->
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" />
1293 <xsl:apply-templates />
1295 <xsl:value-of select="$newline" />
1297 <xsl:call-template name="navigation-bar" />
1299 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1302 <!-- ~~~~~~~~~~~~~ third-level-mainmatter-separate ~~~~~~~~~~~~~~ -->
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" />
1309 <xsl:apply-templates />
1311 <xsl:value-of select="$newline" />
1313 <xsl:call-template name="navigation-bar" />
1315 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1318 <!-- ~~~~~~~~~~~~~~~~ second-level-glossary ~~~~~~~~~~~~~~~~~~~ -->
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" />
1325 <xsl:apply-templates />
1327 <xsl:value-of select="$newline" />
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>
1333 <xsl:call-template name="navigation-bar" />
1335 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1338 <!-- ~~~~~~~~~~~~~ third-level-glossary-separate ~~~~~~~~~~~~~~ -->
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>
1347 <xsl:value-of select="$newline" />
1349 <xsl:apply-templates />
1351 <xsl:value-of select="$newline" />
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" />
1358 <!-- ~~~~~~~~~~~~~~~~~~ second-level-numbered ~~~~~~~~~~~~~~~~~~~~ -->
1361 The following automatically generated section list requires that the
1362 title of each section be a simple number.
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" />
1370 <xsl:variable name="base-section-number" select="number( data/section[1]/meta/title ) - 1" />
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>
1379 <xsl:when test="position( ) + 9 <= last( )">
1380 <xsl:value-of select="position( ) + 9 + $base-section-number" />
1383 <xsl:value-of select="last( ) + $base-section-number" />
1387 </a><xsl:text>: </xsl:text></b>
1390 <xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1391 <xsl:value-of select="meta/title" />
1394 <xsl:when test="position( ) mod 10 = 0">
1395 <br /><xsl:value-of select="$newline" />
1398 <xsl:text> </xsl:text>
1404 <xsl:value-of select="$newline" />
1405 <xsl:value-of select="$newline" />
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" />
1412 <!-- ~~~~~~~~~~~~~~~~~~ third-level-numbered ~~~~~~~~~~~~~~~~~~~~~ -->
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" />
1419 <xsl:apply-templates />
1421 <xsl:value-of select="$newline" />
1422 <xsl:call-template name="navigation-bar" />
1423 <xsl:value-of select="$newline" />
1427 <!-- ~~~~~~~~~~~~~~~~~ second-level-backmatter ~~~~~~~~~~~~~~~~~~~ -->
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" />
1433 <xsl:value-of select="$newline" />
1434 <xsl:value-of select="$newline" />
1436 <xsl:apply-templates />
1438 <xsl:value-of select="$newline" />
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" />
1445 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ map-adjusted ~~~~~~~~~~~~~~~~~~~~~~~~ -->
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" />
1451 <xsl:value-of select="$newline" />
1452 <xsl:value-of select="$newline" />
1454 <xsl:for-each select="data/* | data/text()">
1455 <xsl:variable name="map-illustration-alt-text">
1457 <xsl:when test="$language='es'">
1458 <xsl:text>mapa</xsl:text>
1461 <xsl:text>map</xsl:text>
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" />
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>
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" />
1494 </div></div><xsl:value-of select="$newline" />
1497 <xsl:apply-templates select="." />
1502 <xsl:value-of select="$newline" />
1504 <xsl:call-template name="navigation-bar" />
1505 <xsl:value-of select="$newline" />
1509 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
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" />
1515 <xsl:value-of select="$newline" />
1516 <xsl:value-of select="$newline" />
1518 <xsl:for-each select="data/* | data/text()">
1519 <xsl:variable name="map-illustration-alt-text">
1521 <xsl:when test="$language='es'">
1522 <xsl:text>mapa</xsl:text>
1525 <xsl:text>map</xsl:text>
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" />
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" />
1557 <xsl:apply-templates select="." />
1562 <xsl:value-of select="$newline" />
1564 <xsl:call-template name="navigation-bar" />
1565 <xsl:value-of select="$newline" />
1569 <!-- ~~~~~~~~~~~~~~~~~~~~~~ illustration ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
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" />
1576 <xsl:variable name="illustration-alt-text">
1578 <xsl:when test="$language='es'">
1579 <xsl:text>ilustración</xsl:text>
1582 <xsl:text>illustration</xsl:text>
1589 <xsl:when test="$language='es'">
1590 <xsl:text>Ilustración </xsl:text>
1593 <xsl:text>Illustration </xsl:text>
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" />
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" />
1621 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1625 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1626 <xsl:value-of select="$document-type" />
1627 <xsl:text>".</xsl:text>
1630 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1631 <xsl:value-of select="$document-type" />
1632 <xsl:text>".</xsl:text>
1638 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1640 <xsl:call-template name="process-footnotes" />
1642 <p class="copyright"><xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" /></p><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1644 </div><xsl:value-of select="$newline" />
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>
1655 <xsl:value-of select="$newline" />
1656 <xsl:value-of select="$newline" />
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>
1671 <xsl:for-each select="*[1]">
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()" />
1680 <xsl:for-each select="*[position() != 1]">
1681 <xsl:apply-templates select="." />
1684 </div><xsl:value-of select="$newline" />
1688 <xsl:template name="navigation-bar">
1689 <xsl:variable name="table-of-contents">
1691 <xsl:when test="$language='es'">
1692 <xsl:text>Índice de Contenidos</xsl:text>
1695 <xsl:text>Table of Contents</xsl:text>
1699 <div class="navigation">
1700 <table cellspacing="0" cellpadding="0" border="0">
1704 <xsl:when test="meta/link[@class='prev']">
1706 <xsl:attribute name="href">
1707 <xsl:value-of select="meta/link[@class='prev']/@idref" />
1708 <xsl:text>.htm</xsl:text>
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" />
1718 <img src="left.gif" width="150" height="30" border="0" alt="" />
1722 <td><a href="toc.htm"><img src="toc.gif" width="150" height="30" border="0" alt="{$table-of-contents}" /></a></td>
1725 <xsl:when test="meta/link[@class='next']">
1727 <xsl:attribute name="href">
1728 <xsl:value-of select="meta/link[@class='next']/@idref" />
1729 <xsl:text>.htm</xsl:text>
1731 <img src="forward.gif" width="150" height="30" border="0">
1732 <xsl:attribute name="alt">
1734 <xsl:when test="meta/link[@class='next']/@idref = 'sect1'">
1736 <xsl:when test="$language='es'">
1737 <xsl:text>Sección 1</xsl:text>
1740 <xsl:text>Section 1</xsl:text>
1745 <xsl:value-of select="id( meta/link[@class='next']/@idref )/meta/title" />
1753 <img src="right.gif" width="150" height="30" border="0" alt="" />
1762 <xsl:template name="alpha-bar">
1763 <xsl:param name="alpha-bar-id-prefix"></xsl:param>
1765 <p class="navigation">[<a href="{$alpha-bar-id-prefix}a.htm">A</a> <a href="{$alpha-bar-id-prefix}b.htm">B</a> <a href="{$alpha-bar-id-prefix}c.htm">C</a> <a href="{$alpha-bar-id-prefix}d.htm">D</a> <a href="{$alpha-bar-id-prefix}e.htm">E</a> <a href="{$alpha-bar-id-prefix}f.htm">F</a> <a href="{$alpha-bar-id-prefix}g.htm">G</a> <a href="{$alpha-bar-id-prefix}h.htm">H</a> <a href="{$alpha-bar-id-prefix}i.htm">I</a> <a href="{$alpha-bar-id-prefix}j.htm">J</a> <a href="{$alpha-bar-id-prefix}k.htm">K</a> <a href="{$alpha-bar-id-prefix}l.htm">L</a> <a href="{$alpha-bar-id-prefix}m.htm">M</a> <a href="{$alpha-bar-id-prefix}n.htm">N</a> <a href="{$alpha-bar-id-prefix}o.htm">O</a> <a href="{$alpha-bar-id-prefix}p.htm">P</a> <a href="{$alpha-bar-id-prefix}q.htm">Q</a> <a href="{$alpha-bar-id-prefix}r.htm">R</a> <a href="{$alpha-bar-id-prefix}s.htm">S</a> <a href="{$alpha-bar-id-prefix}t.htm">T</a> <a href="{$alpha-bar-id-prefix}u.htm">U</a> <a href="{$alpha-bar-id-prefix}v.htm">V</a> <a href="{$alpha-bar-id-prefix}w.htm">W</a> <a href="{$alpha-bar-id-prefix}x.htm">X</a> <a href="{$alpha-bar-id-prefix}y.htm">Y</a> <a href="{$alpha-bar-id-prefix}z.htm">Z</a>]</p><xsl:value-of select="$newline" />