2 <!DOCTYPE xsl:transform [
3 <!ENTITY % xhtml.characters SYSTEM "htmlchar.mod">
12 Revision 1.1 2005/01/30 01:32:52 jonathan.blake
13 Initial freepository revision of XML support documents.
15 Revision 1.12 2003/10/07 06:05:14 Jon
16 Added capability for "accent" illustrations.
18 Revision 1.11 2002/12/06 22:12:04 jblake
19 Added default namespace declaration to transformation element
20 and removed all the extraneous declarations in the template
23 Revision 1.10 2002/11/17 22:37:25 jblake
24 Removed the "medium" creator entry from the templates.
25 Will they be of any use?
27 Revision 1.9 2002/11/17 05:06:56 jblake
28 Rearranged the title page.
30 Revision 1.8 2002/11/15 19:35:25 jblake
31 Fixed "Content-type" of XHTML output.
33 Revision 1.7 2002/11/15 00:15:39 jblake
34 Fixed a problem with the client-side image map and fixed
35 the numbered section list generation so that it will work
36 for Shadow on the Sand.
38 Revision 1.6 2002/10/30 05:59:45 jblake
39 Added a value for the alt attribute of the ToC image on the navigation bar.
41 Revision 1.5 2002/10/24 15:53:41 jblake
42 Fixed a conflict with whitespace and paragraphed lists.
44 Revision 1.4 2002/10/24 15:06:51 jblake
45 Added xmlns attributes to all elements that are top level in
46 their templates. This was an adjustment required by Xalan-J 2.4.
48 Also reinstated the comment in each document since the new
49 version of Xalan redirects it properly.
51 Revision 1.3 2002/10/23 05:18:29 jblake
52 Added the capability to filter which illustrators' work is used.
53 This is accomplished by the "use-illustrators" parameter.
55 Revision 1.2 2002/10/20 06:25:35 jblake
56 Added support for CLOSE COMBAT SKILL for Freeway Warrior books.
58 Revision 1.1 2002/10/15 23:29:51 jblake
62 20020327 - repurposed to be used with Xalan Java 2
66 * Add blank whitespace handling to the paragraphed list template
70 <xsl:transform version="1.0"
71 xmlns="http://www.w3.org/1999/xhtml"
72 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
73 xmlns:lxslt="http://xml.apache.org/xslt"
74 xmlns:redirect="org.apache.xalan.lib.Redirect"
75 extension-element-prefixes="redirect">
77 <xsl:output method="xml"
79 omit-xml-declaration="yes"
80 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
81 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
83 <xsl:strip-space elements="section data ol ul dl li dd footnotes footnote" />
84 <xsl:preserve-space elements="p choice" />
86 <!-- ====================== parameters ========================== -->
88 <xsl:param name="book-path"><xsl:text>undefined-book</xsl:text></xsl:param>
89 <xsl:param name="use-illustrators" />
91 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ colors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
93 <xsl:param name="link-color"><xsl:text>#ff0000</xsl:text></xsl:param>
94 <xsl:param name="alink-color"><xsl:value-of select="$link-color" /></xsl:param>
95 <xsl:param name="vlink-color"><xsl:value-of select="$link-color" /></xsl:param>
97 <xsl:param name="text-color"><xsl:text>#000000</xsl:text></xsl:param>
98 <xsl:param name="background-color"><xsl:text>#ffffe4</xsl:text></xsl:param>
100 <!-- ======================= variables ========================== -->
102 <xsl:variable name="newline">
107 <!-- ======================== Templates ========================= -->
109 <!-- ================= hierarchical sections ==================== -->
111 <xsl:template match="meta" />
112 <xsl:template match="section" />
114 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
116 <xsl:template match="/gamebook/section[@id='title']">
117 <xsl:call-template name="xhtml-wrapper">
118 <xsl:with-param name="document-type">top-level</xsl:with-param>
119 <xsl:with-param name="filename">title</xsl:with-param>
122 <xsl:apply-templates />
125 <xsl:template match="/gamebook/section[@id='toc']">
126 <xsl:call-template name="xhtml-wrapper">
127 <xsl:with-param name="document-type">toc</xsl:with-param>
128 <xsl:with-param name="filename">toc</xsl:with-param>
131 <xsl:apply-templates />
134 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
136 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
137 <xsl:call-template name="xhtml-wrapper">
138 <xsl:with-param name="document-type">second-level-frontmatter</xsl:with-param>
139 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
143 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
145 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
146 <h3><xsl:value-of select="meta/title[1]" /></h3>
148 <xsl:value-of select="$newline" />
149 <xsl:value-of select="$newline" />
151 <xsl:apply-templates />
154 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
155 <xsl:call-template name="xhtml-wrapper">
156 <xsl:with-param name="document-type">third-level-frontmatter-separate</xsl:with-param>
157 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
161 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
163 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
164 <h4><xsl:value-of select="meta/title[1]" /></h4>
166 <xsl:value-of select="$newline" />
167 <xsl:value-of select="$newline" />
169 <xsl:apply-templates />
172 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
174 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
175 <h5><xsl:value-of select="meta/title[1]" /></h5>
177 <xsl:value-of select="$newline" />
178 <xsl:value-of select="$newline" />
180 <xsl:apply-templates />
183 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
185 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
186 <xsl:call-template name="xhtml-wrapper">
187 <xsl:with-param name="document-type">second-level-mainmatter</xsl:with-param>
188 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
192 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
194 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
195 <h3><xsl:value-of select="meta/title[1]" /></h3>
197 <xsl:value-of select="$newline" />
198 <xsl:value-of select="$newline" />
200 <xsl:apply-templates />
203 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter-separate']">
204 <xsl:call-template name="xhtml-wrapper">
205 <xsl:with-param name="document-type">third-level-mainmatter-separate</xsl:with-param>
206 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
210 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
212 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
213 <h4><xsl:value-of select="meta/title[1]" /></h4>
215 <xsl:value-of select="$newline" />
216 <xsl:value-of select="$newline" />
218 <xsl:apply-templates />
221 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
223 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
224 <h5><xsl:value-of select="meta/title[1]" /></h5>
226 <xsl:value-of select="$newline" />
227 <xsl:value-of select="$newline" />
229 <xsl:apply-templates />
232 <!-- :::::::::::: second-level glossary sections ::::::::::::: -->
234 <xsl:template match="/gamebook/section/data/section[@class='glossary']">
235 <xsl:call-template name="xhtml-wrapper">
236 <xsl:with-param name="document-type">second-level-glossary</xsl:with-param>
237 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
238 <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
242 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
243 <!-- glossary sections should be enclosed in a second level glossary section -->
245 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary']">
246 <h3><xsl:value-of select="meta/title[1]" /></h3>
248 <xsl:value-of select="$newline" />
249 <xsl:value-of select="$newline" />
251 <xsl:apply-templates />
254 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary-separate']">
255 <xsl:call-template name="xhtml-wrapper">
256 <xsl:with-param name="document-type">third-level-glossary-separate</xsl:with-param>
257 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
258 <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
262 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
264 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
265 <xsl:call-template name="xhtml-wrapper">
266 <xsl:with-param name="document-type">second-level-numbered</xsl:with-param>
267 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
270 <xsl:apply-templates />
273 <xsl:template match="/gamebook/section/data/section/data/section[@class='numbered']">
274 <xsl:call-template name="xhtml-wrapper">
275 <xsl:with-param name="document-type">third-level-numbered</xsl:with-param>
276 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
280 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
282 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
283 <xsl:call-template name="xhtml-wrapper">
284 <xsl:with-param name="document-type">second-level-backmatter</xsl:with-param>
285 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
289 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
291 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
292 <h3><xsl:value-of select="meta/title[1]" /></h3>
294 <xsl:value-of select="$newline" />
295 <xsl:value-of select="$newline" />
297 <xsl:apply-templates />
300 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
302 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
303 <h4><xsl:value-of select="meta/title[1]" /></h4>
305 <xsl:value-of select="$newline" />
306 <xsl:value-of select="$newline" />
308 <xsl:apply-templates />
311 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
313 <xsl:template match="id( 'map' )">
314 <xsl:call-template name="xhtml-wrapper">
315 <xsl:with-param name="document-type">map-adjusted</xsl:with-param>
316 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
319 <xsl:call-template name="xhtml-wrapper">
320 <xsl:with-param name="document-type">map</xsl:with-param>
321 <xsl:with-param name="filename"><xsl:value-of select="@id" /><xsl:text>large</xsl:text></xsl:with-param>
325 <!-- ==================== block elements ======================== -->
327 <xsl:template match="p">
328 <p><xsl:apply-templates /></p>
329 <xsl:value-of select="$newline" />
332 <xsl:template match="p[@class='dedication']">
333 <p class="dedication"><xsl:apply-templates /></p>
334 <xsl:value-of select="$newline" />
337 <xsl:template match="dl[@class='paragraphed']/dd/node() | ol[@class='paragraphed']/li/node() | ul[@class='paragraphed']/li/node()">
339 <xsl:when test="self::p">
340 <xsl:apply-templates /><br /><br /><xsl:value-of select="$newline" />
342 <xsl:when test="self::dl">
343 <dl><xsl:value-of select="$newline" />
344 <xsl:apply-templates />
345 </dl><br /><br /><xsl:value-of select="$newline" />
347 <xsl:when test="self::ol">
348 <ol><xsl:value-of select="$newline" />
349 <xsl:apply-templates />
350 </ol><br /><br /><xsl:value-of select="$newline" />
352 <xsl:when test="self::ul">
354 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
355 <xsl:value-of select="$newline" />
356 <xsl:apply-templates />
357 </ul><br /><br /><xsl:value-of select="$newline" />
359 <xsl:when test="self::blockquote">
360 <blockquote><xsl:value-of select="$newline" />
361 <xsl:apply-templates />
362 </blockquote><xsl:value-of select="$newline" />
364 <xsl:when test="self::illustration">
365 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
366 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
367 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
369 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
370 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
371 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
372 <tr><xsl:value-of select="$newline" />
373 <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
374 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
375 <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
376 </tr><xsl:value-of select="$newline" />
377 <tr><xsl:value-of select="$newline" />
378 <td><img src="brdrl.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
379 <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" border="0" align="middle" alt="[illustration]" /></td><xsl:value-of select="$newline" />
380 <td><img src="brdrr.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
381 </tr><xsl:value-of select="$newline" />
382 <tr><xsl:value-of select="$newline" />
383 <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
384 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
385 <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
386 </tr><xsl:value-of select="$newline" />
387 </table><br /><xsl:value-of select="$newline" />
388 </div></div><xsl:value-of select="$newline" />
392 <xsl:text>[error: paragraphed list template]</xsl:text>
397 <xsl:template match="ol">
398 <ol><xsl:value-of select="$newline" />
399 <xsl:apply-templates />
400 </ol><xsl:value-of select="$newline" />
403 <xsl:template match="ul">
405 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
406 <xsl:value-of select="$newline" />
407 <xsl:apply-templates />
408 </ul><xsl:value-of select="$newline" />
411 <xsl:template match="dl">
412 <dl><xsl:value-of select="$newline" />
413 <xsl:apply-templates />
414 </dl><xsl:value-of select="$newline" />
417 <xsl:template match="dt">
418 <dt><xsl:apply-templates /></dt>
419 <xsl:value-of select="$newline" />
422 <xsl:template match="dd">
423 <dd><xsl:apply-templates /></dd>
424 <xsl:value-of select="$newline" />
427 <xsl:template match="li">
428 <li><xsl:apply-templates /></li>
429 <xsl:value-of select="$newline" />
432 <xsl:template match="table">
433 <table border="1" cellspacing="0" cellpadding="2">
434 <xsl:apply-templates />
436 <xsl:value-of select="$newline" />
439 <xsl:template match="tr">
441 <xsl:apply-templates />
445 <xsl:template match="th">
447 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
448 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
449 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
450 <xsl:apply-templates />
454 <xsl:template match="td">
456 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
457 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
458 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
459 <xsl:apply-templates />
463 <xsl:template match="combat">
465 <xsl:apply-templates select="enemy" />
466 <xsl:text>: </xsl:text>
468 <xsl:when test="enemy-attribute[@class='combatskill']">
469 <span class="smallcaps">COMBAT<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>SKILL</span>
470 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
471 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
473 <xsl:when test="enemy-attribute[@class='closecombatskill']">
474 <span class="smallcaps">CLOSE<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>COMBAT<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>SKILL</span>
475 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
476 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
479 <xsl:text disable-output-escaping="yes"> &nbsp;&nbsp;</xsl:text>
480 <span class="smallcaps">ENDURANCE</span>
482 <xsl:when test="enemy-attribute[@class='target']">
483 <xsl:text> (</xsl:text><span class="smallcaps">TARGET</span><xsl:text> points)</xsl:text>
484 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
485 <xsl:value-of select="enemy-attribute[@class='target']" />
487 <xsl:when test="enemy-attribute[@class='resistance']">
488 <xsl:text> (</xsl:text><span class="smallcaps">RESISTANCE</span><xsl:text> points)</xsl:text>
489 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
490 <xsl:value-of select="enemy-attribute[@class='resistance']" />
493 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
494 <xsl:value-of select="enemy-attribute[@class='endurance']" />
498 <xsl:value-of select="$newline" />
501 <xsl:template match="choice">
502 <xsl:variable name="link">
503 <xsl:value-of select="@idref" />
507 <xsl:for-each select="* | text()">
509 <xsl:when test="self::link-text">
510 <a href="{$link}.htm">
511 <xsl:apply-templates />
515 <xsl:apply-templates select="." />
520 <xsl:value-of select="$newline" />
523 <xsl:template match="signpost">
524 <div class="signpost">
525 <xsl:apply-templates />
527 <xsl:value-of select="$newline" />
530 <xsl:template match="blockquote">
531 <blockquote><xsl:value-of select="$newline" />
532 <xsl:apply-templates /><xsl:value-of select="$newline" />
533 </blockquote><xsl:value-of select="$newline" />
536 <xsl:template match="illustration">
537 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
538 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
539 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
541 <xsl:variable name="illustration-width-adjusted"><xsl:number value="$illustration-width div 2" /></xsl:variable>
542 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height div 2" /></xsl:variable>
544 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
546 <xsl:when test="@class='float'">
547 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
548 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
549 <tr><xsl:value-of select="$newline" />
550 <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
551 <td><img src="brdrtp.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
552 <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
553 </tr><xsl:value-of select="$newline" />
554 <tr><xsl:value-of select="$newline" />
555 <td><img src="brdrl.gif" width="32" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
558 <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>
559 <img src="{$illustration-src}" width="{$illustration-width-adjusted}" height="{$illustration-height-adjusted}" border="0" align="middle" alt="[illustration]" />
561 </td><xsl:value-of select="$newline" />
562 <td><img src="brdrr.gif" width="32" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
563 </tr><xsl:value-of select="$newline" />
564 <tr><xsl:value-of select="$newline" />
565 <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
566 <td><img src="brdrbt.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
567 <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt=""/></td><xsl:value-of select="$newline" />
568 </tr><xsl:value-of select="$newline" />
569 </table><br /><xsl:value-of select="$newline" />
570 </div></div><xsl:value-of select="$newline" />
572 <xsl:call-template name="xhtml-wrapper">
573 <xsl:with-param name="document-type">illustration</xsl:with-param>
574 <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>
578 <xsl:when test="@class='accent'" />
581 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
582 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
583 <tr><xsl:value-of select="$newline" />
584 <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
585 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
586 <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
587 </tr><xsl:value-of select="$newline" />
588 <tr><xsl:value-of select="$newline" />
589 <td><img src="brdrl.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
590 <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" border="0" align="middle" alt="[illustration]" /></td><xsl:value-of select="$newline" />
591 <td><img src="brdrr.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
592 </tr><xsl:value-of select="$newline" />
593 <tr><xsl:value-of select="$newline" />
594 <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
595 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
596 <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
597 </tr><xsl:value-of select="$newline" />
598 </table><br /><xsl:value-of select="$newline" />
599 </div></div><xsl:value-of select="$newline" />
606 <xsl:template match="instance" />
608 <xsl:template match="footnotes" />
610 <xsl:template match="footnote" />
612 <xsl:template match="hr">
614 <xsl:value-of select="$newline" />
617 <!-- ==================== inline elements ======================= -->
619 <xsl:template match="a">
621 <xsl:when test="@href">
623 <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
624 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
625 <xsl:apply-templates />
630 <xsl:if test="@idref">
631 <xsl:variable name="my-idref" select="@idref" />
632 <xsl:attribute name="href">
634 <!-- The order of these tests is deliberate. They are ordered roughly from most to least specific. -->
635 <xsl:when test="/gamebook/section[@id=$my-idref] | /gamebook/section/data/section[@id=$my-idref]">
636 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
638 <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and @id=$my-idref]">
639 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
641 <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and @id=$my-idref]">
642 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
644 <xsl:when test="/gamebook/section/data/section/data/section[@class='numbered' and @id=$my-idref]">
645 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
647 <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and @id=$my-idref]">
648 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
650 <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and descendant::*[@id=$my-idref]]">
651 <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" />
653 <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and descendant::*[@id=$my-idref]]">
654 <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" />
656 <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and descendant::*[@id=$my-idref]]">
657 <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" />
659 <xsl:when test="/gamebook/section/data/section[descendant::*[@id=$my-idref]]">
660 <xsl:value-of select="/gamebook/section/data/section[descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
663 <xsl:text>[error: a template]</xsl:text>
668 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
669 <xsl:apply-templates />
675 <xsl:template match="a[@class='footnote']">
676 <xsl:apply-templates />
679 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
680 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
681 <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
686 <xsl:template match="a[@class='accent-illustration']">
687 <xsl:for-each select="id( @idref )">
688 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
689 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
690 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
691 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
692 <img src="{$illustration-src}" class="accent" width="{$illustration-width}" height="{$illustration-height}" alt="" border="" align="left" />
697 <xsl:template match="em">
698 <em><xsl:apply-templates /></em>
701 <xsl:template match="strong">
702 <strong><xsl:apply-templates /></strong>
705 <xsl:template match="thought">
706 <i><xsl:apply-templates /></i>
709 <xsl:template match="onomatopoeia">
710 <i><xsl:apply-templates /></i>
713 <xsl:template match="spell">
714 <i><xsl:apply-templates /></i>
717 <xsl:template match="item">
718 <xsl:apply-templates />
721 <xsl:template match="foreign">
722 <i><xsl:apply-templates /></i>
725 <xsl:template match="quote">
726 <xsl:text>'</xsl:text>
727 <xsl:apply-templates />
728 <xsl:text>'</xsl:text>
731 <xsl:template match="quote//quote">
732 <xsl:text>"</xsl:text>
733 <xsl:apply-templates />
734 <xsl:text>"</xsl:text>
737 <xsl:template match="cite">
738 <cite><xsl:apply-templates /></cite>
741 <xsl:template match="code">
742 <tt><xsl:apply-templates /></tt>
745 <xsl:template match="br">
749 <xsl:template match="typ[@class='attribute']">
750 <span class="smallcaps"><xsl:apply-templates /></span>
753 <!-- ==================== named templates ======================= -->
755 <xsl:template name="xhtml-wrapper">
756 <xsl:param name="document-type">undefined</xsl:param>
757 <xsl:param name="filename">undefined</xsl:param>
758 <xsl:param name="glossary-id-prefix"></xsl:param>
760 <!-- <redirect:write file="{$book-path}/{$filename}.htm">-->
761 <redirect:write file="{$filename}.htm">
763 <xsl:text>xhtml-wrapper: Cannot write to filename: "</xsl:text>
764 <xsl:value-of select="$filename" /><xsl:text>.htm"</xsl:text>
767 <html xml:lang="en-UK" lang="en-UK">
769 <xsl:value-of select="$newline" />
770 <xsl:value-of select="$newline" />
772 <head><xsl:value-of select="$newline" />
774 <xsl:value-of select="/gamebook/meta/title[1]" />
775 <xsl:text>: </xsl:text>
777 <xsl:when test="$document-type='illustration'">
778 <xsl:text>Illustration </xsl:text>
779 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
781 <xsl:otherwise><xsl:value-of select="meta/title[1]" /></xsl:otherwise>
783 </title><xsl:value-of select="$newline" />
784 <meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" /><xsl:value-of select="$newline" />
785 <meta name="robots" content="noindex,nofollow" /><xsl:value-of select="$newline" />
786 <link rel="stylesheet" href="main.css" type="text/css" /><xsl:value-of select="$newline" />
789 <xsl:value-of select="$newline" />
790 <xsl:value-of select="$newline" />
793 <xsl:text> </xsl:text>
794 <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
795 <xsl:text> Published by </xsl:text>
796 <xsl:apply-templates select="/gamebook/meta/publisher[1]" />
797 <xsl:text>. </xsl:text>
800 <xsl:value-of select="$newline" />
801 <xsl:value-of select="$newline" />
804 <xsl:attribute name="text"><xsl:value-of select="$text-color" /></xsl:attribute>
805 <xsl:attribute name="bgcolor"><xsl:value-of select="$background-color" /></xsl:attribute>
806 <xsl:attribute name="background"><xsl:text>bckgrnd.gif</xsl:text></xsl:attribute>
807 <xsl:attribute name="link"><xsl:value-of select="$link-color" /></xsl:attribute>
808 <xsl:attribute name="alink"><xsl:value-of select="$alink-color" /></xsl:attribute>
809 <xsl:attribute name="vlink"><xsl:value-of select="$vlink-color" /></xsl:attribute>
811 <xsl:value-of select="$newline" />
812 <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" />
813 <div id="body"><xsl:value-of select="$newline" />
817 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ top-level ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
819 <xsl:when test="$document-type='top-level'">
820 <div class="frontmatter"><xsl:value-of select="$newline" />
822 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
823 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
827 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
830 <xsl:text>Publication Date: </xsl:text>
831 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
832 <xsl:text> </xsl:text>
834 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
835 <xsl:text>January</xsl:text>
837 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
838 <xsl:text>February</xsl:text>
840 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
841 <xsl:text>March</xsl:text>
843 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
844 <xsl:text>April</xsl:text>
846 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
847 <xsl:text>May</xsl:text>
849 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
850 <xsl:text>June</xsl:text>
852 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
853 <xsl:text>July</xsl:text>
855 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
856 <xsl:text>August</xsl:text>
858 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
859 <xsl:text>September</xsl:text>
861 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
862 <xsl:text>October</xsl:text>
864 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
865 <xsl:text>November</xsl:text>
867 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
868 <xsl:text>December</xsl:text>
871 <xsl:text>Invalid Month</xsl:text>
874 <xsl:text> </xsl:text>
875 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
878 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
880 <xsl:value-of select="$newline" />
882 <xsl:call-template name="navigation-bar" />
884 <xsl:value-of select="$newline" />
885 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
889 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ toc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
891 <xsl:when test="$document-type='toc'">
892 <div class="frontmatter"><xsl:value-of select="$newline" />
893 <h2>Table of Contents</h2><xsl:value-of select="$newline" />
895 <xsl:value-of select="$newline" />
896 <xsl:value-of select="$newline" />
898 <ul><xsl:value-of select="$newline" />
899 <li><a href="title.htm">Title Page</a></li><xsl:value-of select="$newline" />
900 <xsl:for-each select="/gamebook/section/data/section">
902 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
903 <xsl:value-of select="meta/title[1]" />
905 <xsl:if test="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
906 <xsl:value-of select="$newline" />
907 <ul><xsl:value-of select="$newline" />
908 <xsl:for-each select="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
910 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
911 <xsl:value-of select ="meta/title[1]" />
913 </li><xsl:value-of select="$newline" />
915 </ul><xsl:value-of select="$newline" />
917 </li><xsl:value-of select="$newline" />
919 </ul><xsl:value-of select="$newline" />
921 <xsl:value-of select="$newline" />
922 <xsl:value-of select="$newline" />
923 <xsl:call-template name="navigation-bar" />
924 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
927 <!-- ~~~~~~~~~~~~~~~~ second-level-frontmatter ~~~~~~~~~~~~~~~~~~~ -->
929 <xsl:when test="$document-type='second-level-frontmatter'">
930 <div class="frontmatter"><xsl:value-of select="$newline" />
931 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
933 <xsl:value-of select="$newline" />
935 <xsl:apply-templates />
937 <xsl:value-of select="$newline" />
939 <xsl:call-template name="navigation-bar" />
941 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
944 <!-- ~~~~~~~~~~~~~ third-level-frontmatter-separate ~~~~~~~~~~~~~~ -->
946 <xsl:when test="$document-type='third-level-frontmatter-separate'">
947 <div class="frontmatter"><xsl:value-of select="$newline" />
948 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
949 <xsl:value-of select="$newline" />
951 <xsl:apply-templates />
953 <xsl:value-of select="$newline" />
955 <xsl:call-template name="navigation-bar" />
957 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
960 <!-- ~~~~~~~~~~~~~~~~ second-level-mainmatter ~~~~~~~~~~~~~~~~~~~ -->
962 <xsl:when test="$document-type='second-level-mainmatter'">
963 <div class="mainmatter"><xsl:value-of select="$newline" />
964 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
965 <xsl:value-of select="$newline" />
967 <xsl:apply-templates />
969 <xsl:value-of select="$newline" />
971 <xsl:call-template name="navigation-bar" />
973 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
976 <!-- ~~~~~~~~~~~~~ third-level-mainmatter-separate ~~~~~~~~~~~~~~ -->
978 <xsl:when test="$document-type='third-level-mainmatter-separate'">
979 <div class="mainmatter"><xsl:value-of select="$newline" />
980 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
981 <xsl:value-of select="$newline" />
983 <xsl:apply-templates />
985 <xsl:value-of select="$newline" />
987 <xsl:call-template name="navigation-bar" />
989 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
992 <!-- ~~~~~~~~~~~~~~~~ second-level-glossary ~~~~~~~~~~~~~~~~~~~ -->
994 <xsl:when test="$document-type='second-level-glossary'">
995 <div class="mainmatter"><xsl:value-of select="$newline" />
996 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
997 <xsl:value-of select="$newline" />
999 <xsl:apply-templates />
1001 <xsl:value-of select="$newline" />
1003 <xsl:call-template name="alpha-bar">
1004 <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
1005 </xsl:call-template>
1007 <xsl:call-template name="navigation-bar" />
1009 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1012 <!-- ~~~~~~~~~~~~~ third-level-glossary-separate ~~~~~~~~~~~~~~ -->
1014 <xsl:when test="$document-type='third-level-glossary-separate'">
1015 <div class="glossary"><xsl:value-of select="$newline" />
1016 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1017 <xsl:call-template name="alpha-bar">
1018 <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
1019 </xsl:call-template>
1021 <xsl:value-of select="$newline" />
1023 <xsl:apply-templates />
1025 <xsl:value-of select="$newline" />
1027 <xsl:call-template name="navigation-bar" />
1028 <xsl:value-of select="$newline" />
1029 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1032 <!-- ~~~~~~~~~~~~~~~~~~ second-level-numbered ~~~~~~~~~~~~~~~~~~~~ -->
1035 The following automatically generated section list requires that the
1036 title of each section be a simple number.
1039 <xsl:when test="$document-type='second-level-numbered'">
1040 <div class="numbered"><xsl:value-of select="$newline" />
1041 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1042 <xsl:value-of select="$newline" />
1044 <xsl:variable name="base-section-number" select="number( data/section[1]/meta/title ) - 1" />
1046 <xsl:for-each select="data/section">
1047 <xsl:if test="position( ) mod 10 = 1">
1048 <b><a><xsl:attribute name="name"><xsl:value-of select="position( ) + $base-section-number" /></xsl:attribute>
1049 <xsl:value-of select="position( ) + $base-section-number" />
1050 <xsl:if test="not( position( ) = last( ) )">
1051 <xsl:text>-</xsl:text>
1053 <xsl:when test="position( ) + 9 <= last( )">
1054 <xsl:value-of select="position( ) + 9 + $base-section-number" />
1057 <xsl:value-of select="last( ) + $base-section-number" />
1061 </a><xsl:text>: </xsl:text></b>
1064 <xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1065 <xsl:value-of select="meta/title" />
1068 <xsl:when test="position( ) mod 10 = 0">
1069 <br /><xsl:value-of select="$newline" />
1072 <xsl:text> </xsl:text>
1078 <xsl:value-of select="$newline" />
1079 <xsl:value-of select="$newline" />
1081 <xsl:call-template name="navigation-bar" />
1082 <xsl:value-of select="$newline" />
1083 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1086 <!-- ~~~~~~~~~~~~~~~~~~ third-level-numbered ~~~~~~~~~~~~~~~~~~~~~ -->
1088 <xsl:when test="$document-type='third-level-numbered'">
1089 <div class="numbered"><xsl:value-of select="$newline" />
1090 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1091 <xsl:value-of select="$newline" />
1093 <xsl:apply-templates />
1095 <xsl:value-of select="$newline" />
1096 <xsl:call-template name="navigation-bar" />
1097 <xsl:value-of select="$newline" />
1101 <!-- ~~~~~~~~~~~~~~~~~ second-level-backmatter ~~~~~~~~~~~~~~~~~~~ -->
1103 <xsl:when test="$document-type='second-level-backmatter'">
1104 <div class="frontmatter"><xsl:value-of select="$newline" />
1105 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1107 <xsl:value-of select="$newline" />
1108 <xsl:value-of select="$newline" />
1110 <xsl:apply-templates />
1112 <xsl:value-of select="$newline" />
1114 <xsl:call-template name="navigation-bar" />
1115 <xsl:value-of select="$newline" />
1116 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1119 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ map-adjusted ~~~~~~~~~~~~~~~~~~~~~~~~ -->
1121 <xsl:when test="$document-type='map-adjusted'">
1122 <div class="frontmatter"><xsl:value-of select="$newline" />
1123 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1125 <xsl:value-of select="$newline" />
1126 <xsl:value-of select="$newline" />
1128 <xsl:for-each select="data/* | data/text()">
1130 <xsl:when test="self::illustration and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1131 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1132 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1133 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1135 <xsl:variable name="illustration-width-adjusted"><xsl:number value="386" /></xsl:variable>
1136 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height * $illustration-width-adjusted div $illustration-width" /></xsl:variable>
1138 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1139 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1140 <tr><xsl:value-of select="$newline" />
1141 <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1142 <td><img src="brdrtp.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1143 <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1144 </tr><xsl:value-of select="$newline" />
1145 <tr><xsl:value-of select="$newline" />
1146 <td><img src="brdrl.gif" width="31" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1147 <td><a href="maplarge.htm"><img src="{$illustration-src}" width="{$illustration-width-adjusted}" height="{$illustration-height-adjusted}" align="middle" border="0" alt="[map]" /></a></td><xsl:value-of select="$newline" />
1148 <td><img src="brdrr.gif" width="33" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1149 </tr><xsl:value-of select="$newline" />
1150 <tr><xsl:value-of select="$newline" />
1151 <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1152 <td><img src="brdrbt.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1153 <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1154 </tr><xsl:value-of select="$newline" />
1155 </table><xsl:value-of select="$newline" />
1157 </div></div><xsl:value-of select="$newline" />
1160 <xsl:apply-templates select="." />
1165 <xsl:value-of select="$newline" />
1167 <xsl:call-template name="navigation-bar" />
1168 <xsl:value-of select="$newline" />
1172 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1174 <xsl:when test="$document-type='map'">
1175 <div class="frontmatter"><xsl:value-of select="$newline" />
1176 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1178 <xsl:value-of select="$newline" />
1179 <xsl:value-of select="$newline" />
1181 <xsl:for-each select="data/* | data/text()">
1183 <xsl:when test="self::illustration and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1184 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1185 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1186 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1188 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1189 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1190 <tr><xsl:value-of select="$newline" />
1191 <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1192 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1193 <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1194 </tr><xsl:value-of select="$newline" />
1195 <tr><xsl:value-of select="$newline" />
1196 <td><img src="brdrl.gif" width="31" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1197 <td><a href="map.htm"><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" align="middle" border="0" alt="[map]" /></a></td><xsl:value-of select="$newline" />
1198 <td><img src="brdrr.gif" width="33" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1199 </tr><xsl:value-of select="$newline" />
1200 <tr><xsl:value-of select="$newline" />
1201 <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1202 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1203 <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1204 </tr><xsl:value-of select="$newline" />
1205 </table><br /><xsl:value-of select="$newline" />
1206 </div></div><xsl:value-of select="$newline" />
1209 <xsl:apply-templates select="." />
1214 <xsl:value-of select="$newline" />
1216 <xsl:call-template name="navigation-bar" />
1217 <xsl:value-of select="$newline" />
1221 <!-- ~~~~~~~~~~~~~~~~~~~~~~ illustration ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1223 <xsl:when test="$document-type='illustration'">
1224 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1225 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1226 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1229 <xsl:text>Illustration </xsl:text>
1230 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
1231 </h3><xsl:value-of select="$newline" />
1233 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1234 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1235 <tr><xsl:value-of select="$newline" />
1236 <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1237 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1238 <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1239 </tr><xsl:value-of select="$newline" />
1240 <tr><xsl:value-of select="$newline" />
1241 <td><img src="brdrl.gif" width="31" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1242 <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" align="middle" border="0" alt="[illustration]" /></td><xsl:value-of select="$newline" />
1243 <td><img src="brdrr.gif" width="33" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1244 </tr><xsl:value-of select="$newline" />
1245 <tr><xsl:value-of select="$newline" />
1246 <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1247 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1248 <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1249 </tr><xsl:value-of select="$newline" />
1250 </table><br /><xsl:value-of select="$newline" />
1251 </div></div><xsl:value-of select="$newline" />
1252 <p class="caption"><strong><xsl:apply-templates select="meta/description" /></strong></p><xsl:value-of select="$newline" />
1255 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1259 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1260 <xsl:value-of select="$document-type" />
1261 <xsl:text>".</xsl:text>
1264 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1265 <xsl:value-of select="$document-type" />
1266 <xsl:text>".</xsl:text>
1272 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1274 <xsl:call-template name="process-footnotes" />
1276 <p class="copyright"><xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" /></p><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1278 </div><xsl:value-of select="$newline" />
1280 <map name="imagemap" id="imagemap">
1281 <area shape="rect" coords="0,0,99,99" href="http://www.projectaon.org/" alt="Project Aon" target="_top" />
1282 <area shape="default" href="title.htm">
1283 <xsl:attribute name="alt"><xsl:value-of select="/gamebook/meta/title[1]" /></xsl:attribute>
1289 <xsl:value-of select="$newline" />
1290 <xsl:value-of select="$newline" />
1297 <xsl:template name="process-footnotes">
1298 <xsl:if test="footnotes/footnote">
1299 <div id="footnotes"><xsl:value-of select="$newline" />
1300 <xsl:for-each select="footnotes/footnote">
1301 <xsl:variable name="footnote-idref" select="@idref" />
1302 <xsl:variable name="footnote-id" select="@id" />
1303 <xsl:variable name="footnote-marker"><xsl:number count="footnotes/footnote" from="/" level="any" format="1" /></xsl:variable>
1305 <xsl:for-each select="*[1]">
1307 <xsl:text>[</xsl:text>
1308 <a href="#{$footnote-idref}" name="{$footnote-id}"><xsl:value-of select="$footnote-marker" /></a>
1309 <xsl:text>] </xsl:text>
1310 <xsl:apply-templates select="child::* | child::text()" />
1314 <xsl:for-each select="*[position() != 1]">
1315 <xsl:apply-templates select="." />
1318 </div><xsl:value-of select="$newline" />
1322 <xsl:template name="navigation-bar">
1323 <div class="navigation">
1324 <table cellspacing="0" cellpadding="0" border="0">
1328 <xsl:when test="meta/link[@class='prev']">
1330 <xsl:attribute name="href">
1331 <xsl:value-of select="meta/link[@class='prev']/@idref" />
1332 <xsl:text>.htm</xsl:text>
1334 <img src="back.gif" width="150" height="30" border="0">
1335 <xsl:attribute name="alt">
1336 <xsl:value-of select="id( meta/link[@class='prev']/@idref )/meta/title" />
1342 <img src="left.gif" width="150" height="30" border="0" alt="" />
1346 <td><a href="toc.htm"><img src="toc.gif" width="150" height="30" border="0" alt="Table of Contents" /></a></td>
1349 <xsl:when test="meta/link[@class='next']">
1351 <xsl:attribute name="href">
1352 <xsl:value-of select="meta/link[@class='next']/@idref" />
1353 <xsl:text>.htm</xsl:text>
1355 <img src="forward.gif" width="150" height="30" border="0">
1356 <xsl:attribute name="alt">
1358 <xsl:when test="meta/link[@class='next']/@idref = 'sect1'">
1359 <xsl:text>Section 1</xsl:text>
1362 <xsl:value-of select="id( meta/link[@class='next']/@idref )/meta/title" />
1370 <img src="right.gif" width="150" height="30" border="0" alt="" />
1379 <xsl:template name="alpha-bar">
1380 <xsl:param name="alpha-bar-id-prefix"></xsl:param>
1382 <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" />