2 <!DOCTYPE xsl:transform [
3 <!ENTITY % xhtml.characters SYSTEM "htmlchar.mod">
12 Revision 1.2 2005/04/09 19:51:50 angantyr
13 Added handling of open-ended quotes.
15 Revision 1.1 2005/01/30 01:32:52 jonathan.blake
16 Initial freepository revision of XML support documents.
18 Revision 1.12 2003/10/07 06:05:14 Jon
19 Added capability for "accent" illustrations.
21 Revision 1.11 2002/12/06 22:12:04 jblake
22 Added default namespace declaration to transformation element
23 and removed all the extraneous declarations in the template
26 Revision 1.10 2002/11/17 22:37:25 jblake
27 Removed the "medium" creator entry from the templates.
28 Will they be of any use?
30 Revision 1.9 2002/11/17 05:06:56 jblake
31 Rearranged the title page.
33 Revision 1.8 2002/11/15 19:35:25 jblake
34 Fixed "Content-type" of XHTML output.
36 Revision 1.7 2002/11/15 00:15:39 jblake
37 Fixed a problem with the client-side image map and fixed
38 the numbered section list generation so that it will work
39 for Shadow on the Sand.
41 Revision 1.6 2002/10/30 05:59:45 jblake
42 Added a value for the alt attribute of the ToC image on the navigation bar.
44 Revision 1.5 2002/10/24 15:53:41 jblake
45 Fixed a conflict with whitespace and paragraphed lists.
47 Revision 1.4 2002/10/24 15:06:51 jblake
48 Added xmlns attributes to all elements that are top level in
49 their templates. This was an adjustment required by Xalan-J 2.4.
51 Also reinstated the comment in each document since the new
52 version of Xalan redirects it properly.
54 Revision 1.3 2002/10/23 05:18:29 jblake
55 Added the capability to filter which illustrators' work is used.
56 This is accomplished by the "use-illustrators" parameter.
58 Revision 1.2 2002/10/20 06:25:35 jblake
59 Added support for CLOSE COMBAT SKILL for Freeway Warrior books.
61 Revision 1.1 2002/10/15 23:29:51 jblake
65 20020327 - repurposed to be used with Xalan Java 2
69 * Add blank whitespace handling to the paragraphed list template
73 <xsl:transform version="1.0"
74 xmlns="http://www.w3.org/1999/xhtml"
75 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
76 xmlns:lxslt="http://xml.apache.org/xslt"
77 xmlns:redirect="org.apache.xalan.lib.Redirect"
78 extension-element-prefixes="redirect">
80 <xsl:output method="xml"
82 omit-xml-declaration="yes"
83 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
84 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
86 <xsl:strip-space elements="section data ol ul dl li dd footnotes footnote" />
87 <xsl:preserve-space elements="p choice" />
89 <!-- ====================== parameters ========================== -->
91 <xsl:param name="book-path"><xsl:text>undefined-book</xsl:text></xsl:param>
92 <xsl:param name="use-illustrators" />
94 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ colors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
96 <xsl:param name="link-color"><xsl:text>#ff0000</xsl:text></xsl:param>
97 <xsl:param name="alink-color"><xsl:value-of select="$link-color" /></xsl:param>
98 <xsl:param name="vlink-color"><xsl:value-of select="$link-color" /></xsl:param>
100 <xsl:param name="text-color"><xsl:text>#000000</xsl:text></xsl:param>
101 <xsl:param name="background-color"><xsl:text>#ffffe4</xsl:text></xsl:param>
103 <!-- ======================= variables ========================== -->
105 <xsl:variable name="newline">
110 <!-- ======================== Templates ========================= -->
112 <!-- ================= hierarchical sections ==================== -->
114 <xsl:template match="meta" />
115 <xsl:template match="section" />
117 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
119 <xsl:template match="/gamebook/section[@id='title']">
120 <xsl:call-template name="xhtml-wrapper">
121 <xsl:with-param name="document-type">top-level</xsl:with-param>
122 <xsl:with-param name="filename">title</xsl:with-param>
125 <xsl:apply-templates />
128 <xsl:template match="/gamebook/section[@id='toc']">
129 <xsl:call-template name="xhtml-wrapper">
130 <xsl:with-param name="document-type">toc</xsl:with-param>
131 <xsl:with-param name="filename">toc</xsl:with-param>
134 <xsl:apply-templates />
137 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
139 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
140 <xsl:call-template name="xhtml-wrapper">
141 <xsl:with-param name="document-type">second-level-frontmatter</xsl:with-param>
142 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
146 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
148 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
149 <h3><xsl:value-of select="meta/title[1]" /></h3>
151 <xsl:value-of select="$newline" />
152 <xsl:value-of select="$newline" />
154 <xsl:apply-templates />
157 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
158 <xsl:call-template name="xhtml-wrapper">
159 <xsl:with-param name="document-type">third-level-frontmatter-separate</xsl:with-param>
160 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
164 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
166 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
167 <h4><xsl:value-of select="meta/title[1]" /></h4>
169 <xsl:value-of select="$newline" />
170 <xsl:value-of select="$newline" />
172 <xsl:apply-templates />
175 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
177 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
178 <h5><xsl:value-of select="meta/title[1]" /></h5>
180 <xsl:value-of select="$newline" />
181 <xsl:value-of select="$newline" />
183 <xsl:apply-templates />
186 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
188 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
189 <xsl:call-template name="xhtml-wrapper">
190 <xsl:with-param name="document-type">second-level-mainmatter</xsl:with-param>
191 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
195 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
197 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
198 <h3><xsl:value-of select="meta/title[1]" /></h3>
200 <xsl:value-of select="$newline" />
201 <xsl:value-of select="$newline" />
203 <xsl:apply-templates />
206 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter-separate']">
207 <xsl:call-template name="xhtml-wrapper">
208 <xsl:with-param name="document-type">third-level-mainmatter-separate</xsl:with-param>
209 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
213 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
215 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
216 <h4><xsl:value-of select="meta/title[1]" /></h4>
218 <xsl:value-of select="$newline" />
219 <xsl:value-of select="$newline" />
221 <xsl:apply-templates />
224 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
226 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
227 <h5><xsl:value-of select="meta/title[1]" /></h5>
229 <xsl:value-of select="$newline" />
230 <xsl:value-of select="$newline" />
232 <xsl:apply-templates />
235 <!-- :::::::::::: second-level glossary sections ::::::::::::: -->
237 <xsl:template match="/gamebook/section/data/section[@class='glossary']">
238 <xsl:call-template name="xhtml-wrapper">
239 <xsl:with-param name="document-type">second-level-glossary</xsl:with-param>
240 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
241 <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
245 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
246 <!-- glossary sections should be enclosed in a second level glossary section -->
248 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary']">
249 <h3><xsl:value-of select="meta/title[1]" /></h3>
251 <xsl:value-of select="$newline" />
252 <xsl:value-of select="$newline" />
254 <xsl:apply-templates />
257 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary-separate']">
258 <xsl:call-template name="xhtml-wrapper">
259 <xsl:with-param name="document-type">third-level-glossary-separate</xsl:with-param>
260 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
261 <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
265 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
267 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
268 <xsl:call-template name="xhtml-wrapper">
269 <xsl:with-param name="document-type">second-level-numbered</xsl:with-param>
270 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
273 <xsl:apply-templates />
276 <xsl:template match="/gamebook/section/data/section/data/section[@class='numbered']">
277 <xsl:call-template name="xhtml-wrapper">
278 <xsl:with-param name="document-type">third-level-numbered</xsl:with-param>
279 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
283 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
285 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
286 <xsl:call-template name="xhtml-wrapper">
287 <xsl:with-param name="document-type">second-level-backmatter</xsl:with-param>
288 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
292 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
294 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
295 <h3><xsl:value-of select="meta/title[1]" /></h3>
297 <xsl:value-of select="$newline" />
298 <xsl:value-of select="$newline" />
300 <xsl:apply-templates />
303 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
305 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
306 <h4><xsl:value-of select="meta/title[1]" /></h4>
308 <xsl:value-of select="$newline" />
309 <xsl:value-of select="$newline" />
311 <xsl:apply-templates />
314 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
316 <xsl:template match="id( 'map' )">
317 <xsl:call-template name="xhtml-wrapper">
318 <xsl:with-param name="document-type">map-adjusted</xsl:with-param>
319 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
322 <xsl:call-template name="xhtml-wrapper">
323 <xsl:with-param name="document-type">map</xsl:with-param>
324 <xsl:with-param name="filename"><xsl:value-of select="@id" /><xsl:text>large</xsl:text></xsl:with-param>
328 <!-- ==================== block elements ======================== -->
330 <xsl:template match="p">
331 <p><xsl:apply-templates /></p>
332 <xsl:value-of select="$newline" />
335 <xsl:template match="p[@class='dedication']">
336 <p class="dedication"><xsl:apply-templates /></p>
337 <xsl:value-of select="$newline" />
340 <xsl:template match="dl[@class='paragraphed']/dd/node() | ol[@class='paragraphed']/li/node() | ul[@class='paragraphed']/li/node()">
342 <xsl:when test="self::p">
343 <xsl:apply-templates /><br /><br /><xsl:value-of select="$newline" />
345 <xsl:when test="self::dl">
346 <dl><xsl:value-of select="$newline" />
347 <xsl:apply-templates />
348 </dl><br /><br /><xsl:value-of select="$newline" />
350 <xsl:when test="self::ol">
351 <ol><xsl:value-of select="$newline" />
352 <xsl:apply-templates />
353 </ol><br /><br /><xsl:value-of select="$newline" />
355 <xsl:when test="self::ul">
357 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
358 <xsl:value-of select="$newline" />
359 <xsl:apply-templates />
360 </ul><br /><br /><xsl:value-of select="$newline" />
362 <xsl:when test="self::blockquote">
363 <blockquote><xsl:value-of select="$newline" />
364 <xsl:apply-templates />
365 </blockquote><xsl:value-of select="$newline" />
367 <xsl:when test="self::illustration">
368 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
369 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
370 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
372 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
373 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
374 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
375 <tr><xsl:value-of select="$newline" />
376 <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
377 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
378 <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
379 </tr><xsl:value-of select="$newline" />
380 <tr><xsl:value-of select="$newline" />
381 <td><img src="brdrl.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
382 <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" border="0" align="middle" alt="[illustration]" /></td><xsl:value-of select="$newline" />
383 <td><img src="brdrr.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
384 </tr><xsl:value-of select="$newline" />
385 <tr><xsl:value-of select="$newline" />
386 <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
387 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
388 <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
389 </tr><xsl:value-of select="$newline" />
390 </table><br /><xsl:value-of select="$newline" />
391 </div></div><xsl:value-of select="$newline" />
395 <xsl:text>[error: paragraphed list template]</xsl:text>
400 <xsl:template match="ol">
401 <ol><xsl:value-of select="$newline" />
402 <xsl:apply-templates />
403 </ol><xsl:value-of select="$newline" />
406 <xsl:template match="ul">
408 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
409 <xsl:value-of select="$newline" />
410 <xsl:apply-templates />
411 </ul><xsl:value-of select="$newline" />
414 <xsl:template match="dl">
415 <dl><xsl:value-of select="$newline" />
416 <xsl:apply-templates />
417 </dl><xsl:value-of select="$newline" />
420 <xsl:template match="dt">
421 <dt><xsl:apply-templates /></dt>
422 <xsl:value-of select="$newline" />
425 <xsl:template match="dd">
426 <dd><xsl:apply-templates /></dd>
427 <xsl:value-of select="$newline" />
430 <xsl:template match="li">
431 <li><xsl:apply-templates /></li>
432 <xsl:value-of select="$newline" />
435 <xsl:template match="table">
436 <table border="1" cellspacing="0" cellpadding="2">
437 <xsl:apply-templates />
439 <xsl:value-of select="$newline" />
442 <xsl:template match="tr">
444 <xsl:apply-templates />
448 <xsl:template match="th">
450 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
451 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
452 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
453 <xsl:apply-templates />
457 <xsl:template match="td">
459 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
460 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
461 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
462 <xsl:apply-templates />
466 <xsl:template match="combat">
468 <xsl:apply-templates select="enemy" />
469 <xsl:text>: </xsl:text>
471 <xsl:when test="enemy-attribute[@class='combatskill']">
472 <span class="smallcaps">COMBAT<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>SKILL</span>
473 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
474 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
476 <xsl:when test="enemy-attribute[@class='closecombatskill']">
477 <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>
478 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
479 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
482 <xsl:text disable-output-escaping="yes"> &nbsp;&nbsp;</xsl:text>
483 <span class="smallcaps">ENDURANCE</span>
485 <xsl:when test="enemy-attribute[@class='target']">
486 <xsl:text> (</xsl:text><span class="smallcaps">TARGET</span><xsl:text> points)</xsl:text>
487 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
488 <xsl:value-of select="enemy-attribute[@class='target']" />
490 <xsl:when test="enemy-attribute[@class='resistance']">
491 <xsl:text> (</xsl:text><span class="smallcaps">RESISTANCE</span><xsl:text> points)</xsl:text>
492 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
493 <xsl:value-of select="enemy-attribute[@class='resistance']" />
496 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
497 <xsl:value-of select="enemy-attribute[@class='endurance']" />
501 <xsl:value-of select="$newline" />
504 <xsl:template match="choice">
505 <xsl:variable name="link">
506 <xsl:value-of select="@idref" />
510 <xsl:for-each select="* | text()">
512 <xsl:when test="self::link-text">
513 <a href="{$link}.htm">
514 <xsl:apply-templates />
518 <xsl:apply-templates select="." />
523 <xsl:value-of select="$newline" />
526 <xsl:template match="signpost">
527 <div class="signpost">
528 <xsl:apply-templates />
530 <xsl:value-of select="$newline" />
533 <xsl:template match="blockquote">
534 <blockquote><xsl:value-of select="$newline" />
535 <xsl:apply-templates /><xsl:value-of select="$newline" />
536 </blockquote><xsl:value-of select="$newline" />
539 <xsl:template match="illustration">
540 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
541 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
542 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
544 <xsl:variable name="illustration-width-adjusted"><xsl:number value="$illustration-width div 2" /></xsl:variable>
545 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height div 2" /></xsl:variable>
547 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
549 <xsl:when test="@class='float'">
550 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
551 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
552 <tr><xsl:value-of select="$newline" />
553 <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
554 <td><img src="brdrtp.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
555 <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
556 </tr><xsl:value-of select="$newline" />
557 <tr><xsl:value-of select="$newline" />
558 <td><img src="brdrl.gif" width="32" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
561 <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>
562 <img src="{$illustration-src}" width="{$illustration-width-adjusted}" height="{$illustration-height-adjusted}" border="0" align="middle" alt="[illustration]" />
564 </td><xsl:value-of select="$newline" />
565 <td><img src="brdrr.gif" width="32" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
566 </tr><xsl:value-of select="$newline" />
567 <tr><xsl:value-of select="$newline" />
568 <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
569 <td><img src="brdrbt.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
570 <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt=""/></td><xsl:value-of select="$newline" />
571 </tr><xsl:value-of select="$newline" />
572 </table><br /><xsl:value-of select="$newline" />
573 </div></div><xsl:value-of select="$newline" />
575 <xsl:call-template name="xhtml-wrapper">
576 <xsl:with-param name="document-type">illustration</xsl:with-param>
577 <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>
581 <xsl:when test="@class='accent'" />
584 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
585 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
586 <tr><xsl:value-of select="$newline" />
587 <td><img src="brdrtpl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
588 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
589 <td><img src="brdrtpr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
590 </tr><xsl:value-of select="$newline" />
591 <tr><xsl:value-of select="$newline" />
592 <td><img src="brdrl.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
593 <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" border="0" align="middle" alt="[illustration]" /></td><xsl:value-of select="$newline" />
594 <td><img src="brdrr.gif" width="32" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
595 </tr><xsl:value-of select="$newline" />
596 <tr><xsl:value-of select="$newline" />
597 <td><img src="brdrbtl.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
598 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
599 <td><img src="brdrbtr.gif" width="32" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
600 </tr><xsl:value-of select="$newline" />
601 </table><br /><xsl:value-of select="$newline" />
602 </div></div><xsl:value-of select="$newline" />
609 <xsl:template match="instance" />
611 <xsl:template match="footnotes" />
613 <xsl:template match="footnote" />
615 <xsl:template match="hr">
617 <xsl:value-of select="$newline" />
620 <!-- ==================== inline elements ======================= -->
622 <xsl:template match="a">
624 <xsl:when test="@href">
626 <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
627 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
628 <xsl:apply-templates />
633 <xsl:if test="@idref">
634 <xsl:variable name="my-idref" select="@idref" />
635 <xsl:attribute name="href">
637 <!-- The order of these tests is deliberate. They are ordered roughly from most to least specific. -->
638 <xsl:when test="/gamebook/section[@id=$my-idref] | /gamebook/section/data/section[@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='frontmatter-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='mainmatter-separate' 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='numbered' 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='glossary-separate' and @id=$my-idref]">
651 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
653 <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and descendant::*[@id=$my-idref]]">
654 <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" />
656 <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and descendant::*[@id=$my-idref]]">
657 <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" />
659 <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and descendant::*[@id=$my-idref]]">
660 <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" />
662 <xsl:when test="/gamebook/section/data/section[descendant::*[@id=$my-idref]]">
663 <xsl:value-of select="/gamebook/section/data/section[descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
666 <xsl:text>[error: a template]</xsl:text>
671 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
672 <xsl:apply-templates />
678 <xsl:template match="a[@class='footnote']">
679 <xsl:apply-templates />
682 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
683 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
684 <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
689 <xsl:template match="a[@class='accent-illustration']">
690 <xsl:for-each select="id( @idref )">
691 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
692 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
693 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
694 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
695 <img src="{$illustration-src}" class="accent" width="{$illustration-width}" height="{$illustration-height}" alt="" border="" align="left" />
700 <xsl:template match="em">
701 <em><xsl:apply-templates /></em>
704 <xsl:template match="strong">
705 <strong><xsl:apply-templates /></strong>
708 <xsl:template match="thought">
709 <i><xsl:apply-templates /></i>
712 <xsl:template match="onomatopoeia">
713 <i><xsl:apply-templates /></i>
716 <xsl:template match="spell">
717 <i><xsl:apply-templates /></i>
720 <xsl:template match="item">
721 <xsl:apply-templates />
724 <xsl:template match="foreign">
725 <i><xsl:apply-templates /></i>
728 <xsl:template match="quote">
729 <xsl:text>'</xsl:text>
730 <xsl:apply-templates />
731 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>'</xsl:text></xsl:if>
734 <xsl:template match="quote//quote">
735 <xsl:text>"</xsl:text>
736 <xsl:apply-templates />
737 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>"</xsl:text></xsl:if>
740 <xsl:template match="cite">
741 <cite><xsl:apply-templates /></cite>
744 <xsl:template match="code">
745 <tt><xsl:apply-templates /></tt>
748 <xsl:template match="br">
752 <xsl:template match="typ[@class='attribute']">
753 <span class="smallcaps"><xsl:apply-templates /></span>
756 <!-- ==================== named templates ======================= -->
758 <xsl:template name="xhtml-wrapper">
759 <xsl:param name="document-type">undefined</xsl:param>
760 <xsl:param name="filename">undefined</xsl:param>
761 <xsl:param name="glossary-id-prefix"></xsl:param>
763 <!-- <redirect:write file="{$book-path}/{$filename}.htm">-->
764 <redirect:write file="{$filename}.htm">
766 <xsl:text>xhtml-wrapper: Cannot write to filename: "</xsl:text>
767 <xsl:value-of select="$filename" /><xsl:text>.htm"</xsl:text>
770 <html xml:lang="en-UK" lang="en-UK">
772 <xsl:value-of select="$newline" />
773 <xsl:value-of select="$newline" />
775 <head><xsl:value-of select="$newline" />
777 <xsl:value-of select="/gamebook/meta/title[1]" />
778 <xsl:text>: </xsl:text>
780 <xsl:when test="$document-type='illustration'">
781 <xsl:text>Illustration </xsl:text>
782 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
784 <xsl:otherwise><xsl:value-of select="meta/title[1]" /></xsl:otherwise>
786 </title><xsl:value-of select="$newline" />
787 <meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" /><xsl:value-of select="$newline" />
788 <meta name="robots" content="noindex,nofollow" /><xsl:value-of select="$newline" />
789 <link rel="stylesheet" href="main.css" type="text/css" /><xsl:value-of select="$newline" />
792 <xsl:value-of select="$newline" />
793 <xsl:value-of select="$newline" />
796 <xsl:text> </xsl:text>
797 <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
798 <xsl:text> Published by </xsl:text>
799 <xsl:apply-templates select="/gamebook/meta/publisher[1]" />
800 <xsl:text>. </xsl:text>
803 <xsl:value-of select="$newline" />
804 <xsl:value-of select="$newline" />
807 <xsl:attribute name="text"><xsl:value-of select="$text-color" /></xsl:attribute>
808 <xsl:attribute name="bgcolor"><xsl:value-of select="$background-color" /></xsl:attribute>
809 <xsl:attribute name="background"><xsl:text>bckgrnd.gif</xsl:text></xsl:attribute>
810 <xsl:attribute name="link"><xsl:value-of select="$link-color" /></xsl:attribute>
811 <xsl:attribute name="alink"><xsl:value-of select="$alink-color" /></xsl:attribute>
812 <xsl:attribute name="vlink"><xsl:value-of select="$vlink-color" /></xsl:attribute>
814 <xsl:value-of select="$newline" />
815 <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" />
816 <div id="body"><xsl:value-of select="$newline" />
820 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ top-level ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
822 <xsl:when test="$document-type='top-level'">
823 <div class="frontmatter"><xsl:value-of select="$newline" />
825 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
826 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
830 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
833 <xsl:text>Publication Date: </xsl:text>
834 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
835 <xsl:text> </xsl:text>
837 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
838 <xsl:text>January</xsl:text>
840 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
841 <xsl:text>February</xsl:text>
843 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
844 <xsl:text>March</xsl:text>
846 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
847 <xsl:text>April</xsl:text>
849 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
850 <xsl:text>May</xsl:text>
852 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
853 <xsl:text>June</xsl:text>
855 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
856 <xsl:text>July</xsl:text>
858 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
859 <xsl:text>August</xsl:text>
861 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
862 <xsl:text>September</xsl:text>
864 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
865 <xsl:text>October</xsl:text>
867 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
868 <xsl:text>November</xsl:text>
870 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
871 <xsl:text>December</xsl:text>
874 <xsl:text>Invalid Month</xsl:text>
877 <xsl:text> </xsl:text>
878 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
881 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
883 <xsl:value-of select="$newline" />
885 <xsl:call-template name="navigation-bar" />
887 <xsl:value-of select="$newline" />
888 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
892 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ toc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
894 <xsl:when test="$document-type='toc'">
895 <div class="frontmatter"><xsl:value-of select="$newline" />
896 <h2>Table of Contents</h2><xsl:value-of select="$newline" />
898 <xsl:value-of select="$newline" />
899 <xsl:value-of select="$newline" />
901 <ul><xsl:value-of select="$newline" />
902 <li><a href="title.htm">Title Page</a></li><xsl:value-of select="$newline" />
903 <xsl:for-each select="/gamebook/section/data/section">
905 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
906 <xsl:value-of select="meta/title[1]" />
908 <xsl:if test="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
909 <xsl:value-of select="$newline" />
910 <ul><xsl:value-of select="$newline" />
911 <xsl:for-each select="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
913 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
914 <xsl:value-of select ="meta/title[1]" />
916 </li><xsl:value-of select="$newline" />
918 </ul><xsl:value-of select="$newline" />
920 </li><xsl:value-of select="$newline" />
922 </ul><xsl:value-of select="$newline" />
924 <xsl:value-of select="$newline" />
925 <xsl:value-of select="$newline" />
926 <xsl:call-template name="navigation-bar" />
927 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
930 <!-- ~~~~~~~~~~~~~~~~ second-level-frontmatter ~~~~~~~~~~~~~~~~~~~ -->
932 <xsl:when test="$document-type='second-level-frontmatter'">
933 <div class="frontmatter"><xsl:value-of select="$newline" />
934 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
936 <xsl:value-of select="$newline" />
938 <xsl:apply-templates />
940 <xsl:value-of select="$newline" />
942 <xsl:call-template name="navigation-bar" />
944 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
947 <!-- ~~~~~~~~~~~~~ third-level-frontmatter-separate ~~~~~~~~~~~~~~ -->
949 <xsl:when test="$document-type='third-level-frontmatter-separate'">
950 <div class="frontmatter"><xsl:value-of select="$newline" />
951 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
952 <xsl:value-of select="$newline" />
954 <xsl:apply-templates />
956 <xsl:value-of select="$newline" />
958 <xsl:call-template name="navigation-bar" />
960 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
963 <!-- ~~~~~~~~~~~~~~~~ second-level-mainmatter ~~~~~~~~~~~~~~~~~~~ -->
965 <xsl:when test="$document-type='second-level-mainmatter'">
966 <div class="mainmatter"><xsl:value-of select="$newline" />
967 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
968 <xsl:value-of select="$newline" />
970 <xsl:apply-templates />
972 <xsl:value-of select="$newline" />
974 <xsl:call-template name="navigation-bar" />
976 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
979 <!-- ~~~~~~~~~~~~~ third-level-mainmatter-separate ~~~~~~~~~~~~~~ -->
981 <xsl:when test="$document-type='third-level-mainmatter-separate'">
982 <div class="mainmatter"><xsl:value-of select="$newline" />
983 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
984 <xsl:value-of select="$newline" />
986 <xsl:apply-templates />
988 <xsl:value-of select="$newline" />
990 <xsl:call-template name="navigation-bar" />
992 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
995 <!-- ~~~~~~~~~~~~~~~~ second-level-glossary ~~~~~~~~~~~~~~~~~~~ -->
997 <xsl:when test="$document-type='second-level-glossary'">
998 <div class="mainmatter"><xsl:value-of select="$newline" />
999 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1000 <xsl:value-of select="$newline" />
1002 <xsl:apply-templates />
1004 <xsl:value-of select="$newline" />
1006 <xsl:call-template name="alpha-bar">
1007 <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
1008 </xsl:call-template>
1010 <xsl:call-template name="navigation-bar" />
1012 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1015 <!-- ~~~~~~~~~~~~~ third-level-glossary-separate ~~~~~~~~~~~~~~ -->
1017 <xsl:when test="$document-type='third-level-glossary-separate'">
1018 <div class="glossary"><xsl:value-of select="$newline" />
1019 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1020 <xsl:call-template name="alpha-bar">
1021 <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
1022 </xsl:call-template>
1024 <xsl:value-of select="$newline" />
1026 <xsl:apply-templates />
1028 <xsl:value-of select="$newline" />
1030 <xsl:call-template name="navigation-bar" />
1031 <xsl:value-of select="$newline" />
1032 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1035 <!-- ~~~~~~~~~~~~~~~~~~ second-level-numbered ~~~~~~~~~~~~~~~~~~~~ -->
1038 The following automatically generated section list requires that the
1039 title of each section be a simple number.
1042 <xsl:when test="$document-type='second-level-numbered'">
1043 <div class="numbered"><xsl:value-of select="$newline" />
1044 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1045 <xsl:value-of select="$newline" />
1047 <xsl:variable name="base-section-number" select="number( data/section[1]/meta/title ) - 1" />
1049 <xsl:for-each select="data/section">
1050 <xsl:if test="position( ) mod 10 = 1">
1051 <b><a><xsl:attribute name="name"><xsl:value-of select="position( ) + $base-section-number" /></xsl:attribute>
1052 <xsl:value-of select="position( ) + $base-section-number" />
1053 <xsl:if test="not( position( ) = last( ) )">
1054 <xsl:text>-</xsl:text>
1056 <xsl:when test="position( ) + 9 <= last( )">
1057 <xsl:value-of select="position( ) + 9 + $base-section-number" />
1060 <xsl:value-of select="last( ) + $base-section-number" />
1064 </a><xsl:text>: </xsl:text></b>
1067 <xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1068 <xsl:value-of select="meta/title" />
1071 <xsl:when test="position( ) mod 10 = 0">
1072 <br /><xsl:value-of select="$newline" />
1075 <xsl:text> </xsl:text>
1081 <xsl:value-of select="$newline" />
1082 <xsl:value-of select="$newline" />
1084 <xsl:call-template name="navigation-bar" />
1085 <xsl:value-of select="$newline" />
1086 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1089 <!-- ~~~~~~~~~~~~~~~~~~ third-level-numbered ~~~~~~~~~~~~~~~~~~~~~ -->
1091 <xsl:when test="$document-type='third-level-numbered'">
1092 <div class="numbered"><xsl:value-of select="$newline" />
1093 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1094 <xsl:value-of select="$newline" />
1096 <xsl:apply-templates />
1098 <xsl:value-of select="$newline" />
1099 <xsl:call-template name="navigation-bar" />
1100 <xsl:value-of select="$newline" />
1104 <!-- ~~~~~~~~~~~~~~~~~ second-level-backmatter ~~~~~~~~~~~~~~~~~~~ -->
1106 <xsl:when test="$document-type='second-level-backmatter'">
1107 <div class="frontmatter"><xsl:value-of select="$newline" />
1108 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1110 <xsl:value-of select="$newline" />
1111 <xsl:value-of select="$newline" />
1113 <xsl:apply-templates />
1115 <xsl:value-of select="$newline" />
1117 <xsl:call-template name="navigation-bar" />
1118 <xsl:value-of select="$newline" />
1119 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1122 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ map-adjusted ~~~~~~~~~~~~~~~~~~~~~~~~ -->
1124 <xsl:when test="$document-type='map-adjusted'">
1125 <div class="frontmatter"><xsl:value-of select="$newline" />
1126 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1128 <xsl:value-of select="$newline" />
1129 <xsl:value-of select="$newline" />
1131 <xsl:for-each select="data/* | data/text()">
1133 <xsl:when test="self::illustration and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1134 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1135 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1136 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1138 <xsl:variable name="illustration-width-adjusted"><xsl:number value="386" /></xsl:variable>
1139 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height * $illustration-width-adjusted div $illustration-width" /></xsl:variable>
1141 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1142 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1143 <tr><xsl:value-of select="$newline" />
1144 <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1145 <td><img src="brdrtp.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1146 <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1147 </tr><xsl:value-of select="$newline" />
1148 <tr><xsl:value-of select="$newline" />
1149 <td><img src="brdrl.gif" width="31" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1150 <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" />
1151 <td><img src="brdrr.gif" width="33" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1152 </tr><xsl:value-of select="$newline" />
1153 <tr><xsl:value-of select="$newline" />
1154 <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1155 <td><img src="brdrbt.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1156 <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1157 </tr><xsl:value-of select="$newline" />
1158 </table><xsl:value-of select="$newline" />
1160 </div></div><xsl:value-of select="$newline" />
1163 <xsl:apply-templates select="." />
1168 <xsl:value-of select="$newline" />
1170 <xsl:call-template name="navigation-bar" />
1171 <xsl:value-of select="$newline" />
1175 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1177 <xsl:when test="$document-type='map'">
1178 <div class="frontmatter"><xsl:value-of select="$newline" />
1179 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1181 <xsl:value-of select="$newline" />
1182 <xsl:value-of select="$newline" />
1184 <xsl:for-each select="data/* | data/text()">
1186 <xsl:when test="self::illustration and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1187 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1188 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1189 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1191 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1192 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1193 <tr><xsl:value-of select="$newline" />
1194 <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1195 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1196 <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1197 </tr><xsl:value-of select="$newline" />
1198 <tr><xsl:value-of select="$newline" />
1199 <td><img src="brdrl.gif" width="31" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1200 <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" />
1201 <td><img src="brdrr.gif" width="33" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1202 </tr><xsl:value-of select="$newline" />
1203 <tr><xsl:value-of select="$newline" />
1204 <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1205 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1206 <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1207 </tr><xsl:value-of select="$newline" />
1208 </table><br /><xsl:value-of select="$newline" />
1209 </div></div><xsl:value-of select="$newline" />
1212 <xsl:apply-templates select="." />
1217 <xsl:value-of select="$newline" />
1219 <xsl:call-template name="navigation-bar" />
1220 <xsl:value-of select="$newline" />
1224 <!-- ~~~~~~~~~~~~~~~~~~~~~~ illustration ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1226 <xsl:when test="$document-type='illustration'">
1227 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1228 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1229 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1232 <xsl:text>Illustration </xsl:text>
1233 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
1234 </h3><xsl:value-of select="$newline" />
1236 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1237 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1238 <tr><xsl:value-of select="$newline" />
1239 <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1240 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1241 <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1242 </tr><xsl:value-of select="$newline" />
1243 <tr><xsl:value-of select="$newline" />
1244 <td><img src="brdrl.gif" width="31" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1245 <td><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" align="middle" border="0" alt="[illustration]" /></td><xsl:value-of select="$newline" />
1246 <td><img src="brdrr.gif" width="33" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1247 </tr><xsl:value-of select="$newline" />
1248 <tr><xsl:value-of select="$newline" />
1249 <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1250 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1251 <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1252 </tr><xsl:value-of select="$newline" />
1253 </table><br /><xsl:value-of select="$newline" />
1254 </div></div><xsl:value-of select="$newline" />
1255 <p class="caption"><strong><xsl:apply-templates select="meta/description" /></strong></p><xsl:value-of select="$newline" />
1258 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1262 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1263 <xsl:value-of select="$document-type" />
1264 <xsl:text>".</xsl:text>
1267 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1268 <xsl:value-of select="$document-type" />
1269 <xsl:text>".</xsl:text>
1275 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1277 <xsl:call-template name="process-footnotes" />
1279 <p class="copyright"><xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" /></p><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1281 </div><xsl:value-of select="$newline" />
1283 <map name="imagemap" id="imagemap">
1284 <area shape="rect" coords="0,0,99,99" href="http://www.projectaon.org/" alt="Project Aon" target="_top" />
1285 <area shape="default" href="title.htm">
1286 <xsl:attribute name="alt"><xsl:value-of select="/gamebook/meta/title[1]" /></xsl:attribute>
1292 <xsl:value-of select="$newline" />
1293 <xsl:value-of select="$newline" />
1300 <xsl:template name="process-footnotes">
1301 <xsl:if test="footnotes/footnote">
1302 <div id="footnotes"><xsl:value-of select="$newline" />
1303 <xsl:for-each select="footnotes/footnote">
1304 <xsl:variable name="footnote-idref" select="@idref" />
1305 <xsl:variable name="footnote-id" select="@id" />
1306 <xsl:variable name="footnote-marker"><xsl:number count="footnotes/footnote" from="/" level="any" format="1" /></xsl:variable>
1308 <xsl:for-each select="*[1]">
1310 <xsl:text>[</xsl:text>
1311 <a href="#{$footnote-idref}" name="{$footnote-id}"><xsl:value-of select="$footnote-marker" /></a>
1312 <xsl:text>] </xsl:text>
1313 <xsl:apply-templates select="child::* | child::text()" />
1317 <xsl:for-each select="*[position() != 1]">
1318 <xsl:apply-templates select="." />
1321 </div><xsl:value-of select="$newline" />
1325 <xsl:template name="navigation-bar">
1326 <div class="navigation">
1327 <table cellspacing="0" cellpadding="0" border="0">
1331 <xsl:when test="meta/link[@class='prev']">
1333 <xsl:attribute name="href">
1334 <xsl:value-of select="meta/link[@class='prev']/@idref" />
1335 <xsl:text>.htm</xsl:text>
1337 <img src="back.gif" width="150" height="30" border="0">
1338 <xsl:attribute name="alt">
1339 <xsl:value-of select="id( meta/link[@class='prev']/@idref )/meta/title" />
1345 <img src="left.gif" width="150" height="30" border="0" alt="" />
1349 <td><a href="toc.htm"><img src="toc.gif" width="150" height="30" border="0" alt="Table of Contents" /></a></td>
1352 <xsl:when test="meta/link[@class='next']">
1354 <xsl:attribute name="href">
1355 <xsl:value-of select="meta/link[@class='next']/@idref" />
1356 <xsl:text>.htm</xsl:text>
1358 <img src="forward.gif" width="150" height="30" border="0">
1359 <xsl:attribute name="alt">
1361 <xsl:when test="meta/link[@class='next']/@idref = 'sect1'">
1362 <xsl:text>Section 1</xsl:text>
1365 <xsl:value-of select="id( meta/link[@class='next']/@idref )/meta/title" />
1373 <img src="right.gif" width="150" height="30" border="0" alt="" />
1382 <xsl:template name="alpha-bar">
1383 <xsl:param name="alpha-bar-id-prefix"></xsl:param>
1385 <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" />