2 <!DOCTYPE xhtml-transform [
3 <!ENTITY nbsp " ">
11 Revision 1.2 2005/04/09 19:51:50 angantyr
12 Added handling of open-ended quotes.
14 Revision 1.1 2005/01/30 01:32:52 jonathan.blake
15 Initial freepository revision of XML support documents.
17 Revision 1.1 2003/01/15 17:22:44 jblake
21 Revision 1.1 2002/10/22 16:35:26 jblake
25 Revision 1.2 2002/10/20 06:25:35 jblake
26 Added support for CLOSE COMBAT SKILL for Freeway Warrior books.
28 Revision 1.1 2002/10/15 23:29:51 jblake
32 20020327 - repurposed to be used with Xalan Java 2
35 <xsl:transform version="1.0"
36 xmlns:xml="http://www.w3.org/XML/1998/namespace"
37 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
38 xmlns:lxslt="http://xml.apache.org/xslt"
39 xmlns:redirect="org.apache.xalan.lib.Redirect"
40 extension-element-prefixes="redirect">
42 <xsl:output method="xml"
44 omit-xml-declaration="yes"
45 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
46 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
48 <xsl:strip-space elements="section data ol ul dl li dd footnotes footnote" />
49 <xsl:preserve-space elements="p" />
51 <!-- ====================== parameters ========================== -->
53 <xsl:param name="book-path"><xsl:text>undefined-book</xsl:text></xsl:param>
55 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ colors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
57 <xsl:param name="link-color"><xsl:text>#ff0000</xsl:text></xsl:param>
58 <xsl:param name="alink-color"><xsl:value-of select="$link-color" /></xsl:param>
59 <xsl:param name="vlink-color"><xsl:value-of select="$link-color" /></xsl:param>
61 <xsl:param name="text-color"><xsl:text>#000000</xsl:text></xsl:param>
62 <xsl:param name="background-color"><xsl:text>ffffe4</xsl:text></xsl:param>
64 <!-- ======================= variables ========================== -->
66 <xsl:variable name="newline">
71 <!-- ======================== Templates ========================= -->
73 <!-- ================= hierarchical sections ==================== -->
75 <xsl:template match="meta" />
76 <xsl:template match="section" />
78 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
80 <xsl:template match="/gamebook/section">
81 <xsl:call-template name="xhtml-wrapper">
82 <xsl:with-param name="document-type">top-level</xsl:with-param>
83 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
86 <xsl:call-template name="xhtml-wrapper">
87 <xsl:with-param name="document-type">toc</xsl:with-param>
88 <xsl:with-param name="filename">toc</xsl:with-param>
91 <xsl:apply-templates />
95 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
97 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
98 <xsl:call-template name="xhtml-wrapper">
99 <xsl:with-param name="document-type">second-level-frontmatter</xsl:with-param>
100 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
104 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
106 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
107 <h3><xsl:value-of select="meta/title[1]" /></h3>
109 <xsl:value-of select="$newline" />
110 <xsl:value-of select="$newline" />
112 <xsl:apply-templates />
115 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
116 <xsl:call-template name="xhtml-wrapper">
117 <xsl:with-param name="document-type">third-level-frontmatter-separate</xsl:with-param>
118 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
122 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
124 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
125 <h4><xsl:value-of select="meta/title[1]" /></h4>
127 <xsl:value-of select="$newline" />
128 <xsl:value-of select="$newline" />
130 <xsl:apply-templates />
133 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
135 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
136 <h5><xsl:value-of select="meta/title[1]" /></h5>
138 <xsl:value-of select="$newline" />
139 <xsl:value-of select="$newline" />
141 <xsl:apply-templates />
144 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
146 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
147 <xsl:call-template name="xhtml-wrapper">
148 <xsl:with-param name="document-type">second-level-mainmatter</xsl:with-param>
149 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
153 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
155 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
156 <h3><xsl:value-of select="meta/title[1]" /></h3>
158 <xsl:value-of select="$newline" />
159 <xsl:value-of select="$newline" />
161 <xsl:apply-templates />
164 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter-separate']">
165 <xsl:call-template name="xhtml-wrapper">
166 <xsl:with-param name="document-type">third-level-mainmatter-separate</xsl:with-param>
167 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
171 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
173 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
174 <h4><xsl:value-of select="meta/title[1]" /></h4>
176 <xsl:value-of select="$newline" />
177 <xsl:value-of select="$newline" />
179 <xsl:apply-templates />
182 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
184 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
185 <h5><xsl:value-of select="meta/title[1]" /></h5>
187 <xsl:value-of select="$newline" />
188 <xsl:value-of select="$newline" />
190 <xsl:apply-templates />
193 <!-- :::::::::::: second-level glossary sections ::::::::::::: -->
195 <xsl:template match="/gamebook/section/data/section[@class='glossary']">
196 <xsl:call-template name="xhtml-wrapper">
197 <xsl:with-param name="document-type">second-level-glossary</xsl:with-param>
198 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
199 <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
203 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
204 <!-- glossary sections should be enclosed in a second level glossary section -->
206 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary']">
207 <h3><xsl:value-of select="meta/title[1]" /></h3>
209 <xsl:value-of select="$newline" />
210 <xsl:value-of select="$newline" />
212 <xsl:apply-templates />
215 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary-separate']">
216 <xsl:call-template name="xhtml-wrapper">
217 <xsl:with-param name="document-type">third-level-glossary-separate</xsl:with-param>
218 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
219 <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
223 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
225 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
226 <xsl:call-template name="xhtml-wrapper">
227 <xsl:with-param name="document-type">second-level-numbered</xsl:with-param>
228 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
231 <xsl:apply-templates />
234 <xsl:template match="/gamebook/section/data/section/data/section[@class='numbered']">
235 <xsl:call-template name="xhtml-wrapper">
236 <xsl:with-param name="document-type">third-level-numbered</xsl:with-param>
237 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
241 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
243 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
244 <xsl:call-template name="xhtml-wrapper">
245 <xsl:with-param name="document-type">second-level-backmatter</xsl:with-param>
246 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
250 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
252 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
253 <h3><xsl:value-of select="meta/title[1]" /></h3>
255 <xsl:value-of select="$newline" />
256 <xsl:value-of select="$newline" />
258 <xsl:apply-templates />
261 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
263 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
264 <h4><xsl:value-of select="meta/title[1]" /></h4>
266 <xsl:value-of select="$newline" />
267 <xsl:value-of select="$newline" />
269 <xsl:apply-templates />
272 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
274 <xsl:template match="id( 'map' )">
275 <xsl:call-template name="xhtml-wrapper">
276 <xsl:with-param name="document-type">map-adjusted</xsl:with-param>
277 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
280 <xsl:call-template name="xhtml-wrapper">
281 <xsl:with-param name="document-type">map</xsl:with-param>
282 <xsl:with-param name="filename"><xsl:value-of select="@id" /><xsl:text>large</xsl:text></xsl:with-param>
286 <!-- ==================== block elements ======================== -->
288 <xsl:template match="p">
289 <p><xsl:apply-templates /></p>
290 <xsl:value-of select="$newline" />
293 <xsl:template match="p[@class='dedication']">
294 <p class="dedication"><xsl:apply-templates /></p>
295 <xsl:value-of select="$newline" />
298 <xsl:template match="dl[@class='paragraphed']/dd/node() | ol[@class='paragraphed']/li/node() | ul[@class='paragraphed']/li/node()">
300 <xsl:when test="self::p">
301 <xsl:apply-templates /><br /><br /><xsl:value-of select="$newline" />
303 <xsl:when test="self::dl">
304 <dl><xsl:value-of select="$newline" />
305 <xsl:apply-templates />
306 </dl><br /><br /><xsl:value-of select="$newline" />
308 <xsl:when test="self::ol">
309 <ol><xsl:value-of select="$newline" />
310 <xsl:apply-templates />
311 </ol><br /><br /><xsl:value-of select="$newline" />
313 <xsl:when test="self::ul">
315 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
316 <xsl:value-of select="$newline" />
317 <xsl:apply-templates />
318 </ul><br /><br /><xsl:value-of select="$newline" />
320 <xsl:when test="self::blockquote">
321 <blockquote><xsl:value-of select="$newline" />
322 <xsl:apply-templates />
323 </blockquote><xsl:value-of select="$newline" />
325 <xsl:when test="self::illustration">
326 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
327 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
328 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
330 <xsl:if test="instance[@class='pdaxhtml']">
331 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
332 <p><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" border="0" align="middle" alt="[illustration]" /></p><xsl:value-of select="$newline" />
333 </div></div><xsl:value-of select="$newline" />
337 <xsl:text>[error: paragraphed list template]</xsl:text>
342 <xsl:template match="ol">
343 <ol><xsl:value-of select="$newline" />
344 <xsl:apply-templates />
345 </ol><xsl:value-of select="$newline" />
348 <xsl:template match="ul">
350 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
351 <xsl:value-of select="$newline" />
352 <xsl:apply-templates />
353 </ul><xsl:value-of select="$newline" />
356 <xsl:template match="dl">
357 <dl><xsl:value-of select="$newline" />
358 <xsl:apply-templates />
359 </dl><xsl:value-of select="$newline" />
362 <xsl:template match="dt">
363 <dt><xsl:apply-templates /></dt>
364 <xsl:value-of select="$newline" />
367 <xsl:template match="dd">
368 <dd><xsl:apply-templates /></dd>
369 <xsl:value-of select="$newline" />
372 <xsl:template match="li">
373 <li><xsl:apply-templates /></li>
374 <xsl:value-of select="$newline" />
377 <xsl:template match="table">
378 <table border="1" cellspacing="0" cellpadding="2">
379 <xsl:apply-templates />
381 <xsl:value-of select="$newline" />
384 <xsl:template match="tr">
386 <xsl:apply-templates />
390 <xsl:template match="th">
392 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
393 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
394 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
395 <xsl:apply-templates />
399 <xsl:template match="td">
401 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
402 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
403 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
404 <xsl:apply-templates />
408 <xsl:template match="combat">
410 <xsl:apply-templates select="enemy" />
411 <xsl:text>: </xsl:text>
413 <xsl:when test="enemy-attribute[@class='combatskill']">
414 <span class="smallcaps">COMBAT<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>SKILL</span>
415 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
416 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
418 <xsl:when test="enemy-attribute[@class='closecombatskill']">
419 <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>
420 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
421 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
424 <xsl:text disable-output-escaping="yes"> &nbsp;&nbsp;</xsl:text>
425 <span class="smallcaps">ENDURANCE</span>
427 <xsl:when test="enemy-attribute[@class='target']">
428 <xsl:text>(</xsl:text><span class="smallcaps">TARGET</span><xsl:text> points)</xsl:text>
429 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
430 <xsl:value-of select="enemy-attribute[@class='target']" />
432 <xsl:when test="enemy-attribute[@class='resistance']">
433 <xsl:text>(</xsl:text><span class="smallcaps">RESISTANCE</span><xsl:text> points)</xsl:text>
434 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
435 <xsl:value-of select="enemy-attribute[@class='resistance']" />
438 <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
439 <xsl:value-of select="enemy-attribute[@class='endurance']" />
443 <xsl:value-of select="$newline" />
446 <xsl:template match="choice">
447 <xsl:variable name="link">
448 <xsl:value-of select="@idref" />
452 <xsl:for-each select="* | text()">
454 <xsl:when test="self::link-text">
455 <a href="{$link}.htm">
456 <xsl:apply-templates />
460 <xsl:apply-templates select="." />
465 <xsl:value-of select="$newline" />
468 <xsl:template match="signpost">
469 <div class="signpost">
470 <xsl:apply-templates />
472 <xsl:value-of select="$newline" />
475 <xsl:template match="blockquote">
476 <blockquote><xsl:value-of select="$newline" />
477 <xsl:apply-templates /><xsl:value-of select="$newline" />
478 </blockquote><xsl:value-of select="$newline" />
481 <xsl:template match="illustration">
482 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
483 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
484 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
486 <xsl:variable name="illustration-width-adjusted"><xsl:number value="$illustration-width div 2" /></xsl:variable>
487 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height div 2" /></xsl:variable>
489 <xsl:if test="instance[@class='pdaxhtml']">
491 <xsl:when test="@class='float'">
492 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
495 <xsl:attribute name="href"><xsl:text>ill</xsl:text><xsl:number count="illustration[@class='float']" from="/" level="any" format="1" /><xsl:text>.htm</xsl:text></xsl:attribute>
496 <img src="{$illustration-src}" width="{$illustration-width-adjusted}" height="{$illustration-height-adjusted}" border="0" align="middle" alt="[illustration]" />
498 </p><xsl:value-of select="$newline" />
499 </div></div><xsl:value-of select="$newline" />
501 <xsl:call-template name="xhtml-wrapper">
502 <xsl:with-param name="document-type">illustration</xsl:with-param>
503 <xsl:with-param name="filename"><xsl:text>ill</xsl:text><xsl:number count="illustration[@class='float']" from="/" level="any" format="1" /></xsl:with-param>
508 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
509 <p><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" border="0" align="middle" alt="[illustration]" /></p><xsl:value-of select="$newline" />
510 </div></div><xsl:value-of select="$newline" />
517 <xsl:template match="instance" />
519 <xsl:template match="footnotes" />
521 <xsl:template match="footnote" />
523 <xsl:template match="hr">
525 <xsl:value-of select="$newline" />
528 <!-- ==================== inline elements ======================= -->
530 <xsl:template match="a">
532 <xsl:when test="@href">
534 <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
535 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
536 <xsl:apply-templates />
541 <xsl:if test="@idref">
542 <xsl:variable name="my-idref" select="@idref" />
543 <xsl:attribute name="href">
545 <!-- The order of these tests is deliberate. They are ordered roughly from most to least specific. -->
546 <xsl:when test="/gamebook/section[@id=$my-idref] | /gamebook/section/data/section[@id=$my-idref]">
547 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
549 <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and @id=$my-idref]">
550 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
552 <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and @id=$my-idref]">
553 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
555 <xsl:when test="/gamebook/section/data/section/data/section[@class='numbered' and @id=$my-idref]">
556 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
558 <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and @id=$my-idref]">
559 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
561 <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and descendant::*[@id=$my-idref]]">
562 <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" />
564 <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and descendant::*[@id=$my-idref]]">
565 <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" />
567 <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and descendant::*[@id=$my-idref]]">
568 <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" />
570 <xsl:when test="/gamebook/section/data/section[descendant::*[@id=$my-idref]]">
571 <xsl:value-of select="/gamebook/section/data/section[descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
574 <xsl:text>[error: "a" template]</xsl:text>
579 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
580 <xsl:apply-templates />
586 <xsl:template match="a[@class='footnote']">
587 <xsl:apply-templates />
590 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
591 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
592 <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
597 <xsl:template match="em">
598 <em><xsl:apply-templates /></em>
601 <xsl:template match="strong">
602 <strong><xsl:apply-templates /></strong>
605 <xsl:template match="thought">
606 <i><xsl:apply-templates /></i>
609 <xsl:template match="onomatopoeia">
610 <i><xsl:apply-templates /></i>
613 <xsl:template match="spell">
614 <i><xsl:apply-templates /></i>
617 <xsl:template match="item">
618 <xsl:apply-templates />
621 <xsl:template match="foreign">
622 <i><xsl:apply-templates /></i>
625 <xsl:template match="quote">
626 <xsl:text>'</xsl:text>
627 <xsl:apply-templates />
628 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>'</xsl:text></xsl:if>
631 <xsl:template match="quote//quote">
632 <xsl:text>"</xsl:text>
633 <xsl:apply-templates />
634 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>"</xsl:text></xsl:if>
637 <xsl:template match="cite">
638 <cite><xsl:apply-templates /></cite>
641 <xsl:template match="code">
642 <tt><xsl:apply-templates /></tt>
645 <xsl:template match="br">
649 <xsl:template match="typ[@class='attribute']">
650 <span class="smallcaps"><xsl:apply-templates /></span>
653 <!-- ==================== named templates ======================= -->
655 <xsl:template name="xhtml-wrapper">
656 <xsl:param name="document-type">undefined</xsl:param>
657 <xsl:param name="filename">undefined</xsl:param>
658 <xsl:param name="glossary-id-prefix"></xsl:param>
660 <redirect:write file="{$book-path}/{$filename}.htm">
662 <xsl:text>xhtml-wrapper: Cannot write to filename: "</xsl:text>
663 <xsl:value-of select="$filename" /><xsl:text>.htm"</xsl:text>
667 <xsl:text> </xsl:text>
668 <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
669 <xsl:text> Published by </xsl:text>
670 <xsl:value-of select="/gamebook/meta/publisher[1]" />
671 <xsl:text>. </xsl:text>
673 <xsl:value-of select="$newline" />
675 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-UK" lang="en-UK">
677 <xsl:value-of select="$newline" />
678 <xsl:value-of select="$newline" />
680 <head><xsl:value-of select="$newline" />
682 <xsl:value-of select="/gamebook/meta/title[1]" />
683 <xsl:text>: </xsl:text>
685 <xsl:when test="$document-type='illustration'">
686 <xsl:text>Illustration </xsl:text>
687 <xsl:number count="illustration[@class='float']" from="/" level="any" format="I" />
689 <xsl:otherwise><xsl:value-of select="meta/title[1]" /></xsl:otherwise>
691 </title><xsl:value-of select="$newline" />
692 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><xsl:value-of select="$newline" />
693 <meta name="robots" content="noindex,nofollow" /><xsl:value-of select="$newline" />
694 <link rel="stylesheet" href="main.css" type="text/css" /><xsl:value-of select="$newline" />
697 <xsl:value-of select="$newline" />
698 <xsl:value-of select="$newline" />
701 <xsl:attribute name="text"><xsl:value-of select="$text-color" /></xsl:attribute>
702 <xsl:attribute name="bgcolor"><xsl:value-of select="$background-color" /></xsl:attribute>
703 <xsl:attribute name="background"><xsl:text>bckgrnd.gif</xsl:text></xsl:attribute>
704 <xsl:attribute name="link"><xsl:value-of select="$link-color" /></xsl:attribute>
705 <xsl:attribute name="alink"><xsl:value-of select="$alink-color" /></xsl:attribute>
706 <xsl:attribute name="vlink"><xsl:value-of select="$vlink-color" /></xsl:attribute>
708 <xsl:value-of select="$newline" />
709 <h1><xsl:value-of select="/gamebook/meta/title[1]" /></h1><xsl:value-of select="$newline" />
710 <div id="body"><xsl:value-of select="$newline" />
714 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ top-level ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
716 <xsl:when test="$document-type='top-level'">
717 <div class="frontmatter"><xsl:value-of select="$newline" />
718 <p class="author"><xsl:apply-templates select="/gamebook/meta/creator[@class='medium']" /></p>
720 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
723 <xsl:text>Publication Date: </xsl:text>
724 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
725 <xsl:text> </xsl:text>
727 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
728 <xsl:text>January</xsl:text>
730 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
731 <xsl:text>February</xsl:text>
733 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
734 <xsl:text>March</xsl:text>
736 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
737 <xsl:text>April</xsl:text>
739 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
740 <xsl:text>May</xsl:text>
742 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
743 <xsl:text>June</xsl:text>
745 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
746 <xsl:text>July</xsl:text>
748 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
749 <xsl:text>August</xsl:text>
751 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
752 <xsl:text>September</xsl:text>
754 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
755 <xsl:text>October</xsl:text>
757 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
758 <xsl:text>November</xsl:text>
760 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
761 <xsl:text>December</xsl:text>
764 <xsl:text>Invalid Month</xsl:text>
767 <xsl:text> </xsl:text>
768 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
771 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
775 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
776 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
778 <xsl:value-of select="$newline" />
780 <xsl:call-template name="navigation-bar" />
782 <xsl:value-of select="$newline" />
783 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
787 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ toc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
789 <xsl:when test="$document-type='toc'">
790 <div class="frontmatter"><xsl:value-of select="$newline" />
791 <h2>Table of Contents</h2><xsl:value-of select="$newline" />
793 <xsl:value-of select="$newline" />
794 <xsl:value-of select="$newline" />
796 <ul><xsl:value-of select="$newline" />
798 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
799 <xsl:value-of select="meta/title[1]" />
802 <xsl:for-each select="data/section">
804 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
805 <xsl:value-of select="meta/title[1]" />
807 <xsl:if test="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
808 <xsl:value-of select="$newline" />
809 <ul><xsl:value-of select="$newline" />
810 <xsl:for-each select="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
812 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
813 <xsl:value-of select ="meta/title[1]" />
815 </li><xsl:value-of select="$newline" />
817 </ul><xsl:value-of select="$newline" />
819 </li><xsl:value-of select="$newline" />
821 </ul><xsl:value-of select="$newline" />
823 <xsl:value-of select="$newline" />
824 <xsl:value-of select="$newline" />
825 <xsl:call-template name="navigation-bar" />
826 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
829 <!-- ~~~~~~~~~~~~~~~~ second-level-frontmatter ~~~~~~~~~~~~~~~~~~~ -->
831 <xsl:when test="$document-type='second-level-frontmatter'">
832 <div class="frontmatter"><xsl:value-of select="$newline" />
833 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
835 <xsl:value-of select="$newline" />
837 <xsl:apply-templates />
839 <xsl:value-of select="$newline" />
841 <xsl:call-template name="navigation-bar" />
843 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
846 <!-- ~~~~~~~~~~~~~ third-level-frontmatter-separate ~~~~~~~~~~~~~~ -->
848 <xsl:when test="$document-type='third-level-frontmatter-separate'">
849 <div class="frontmatter"><xsl:value-of select="$newline" />
850 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
851 <xsl:value-of select="$newline" />
853 <xsl:apply-templates />
855 <xsl:value-of select="$newline" />
857 <xsl:call-template name="navigation-bar" />
859 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
862 <!-- ~~~~~~~~~~~~~~~~ second-level-mainmatter ~~~~~~~~~~~~~~~~~~~ -->
864 <xsl:when test="$document-type='second-level-mainmatter'">
865 <div class="mainmatter"><xsl:value-of select="$newline" />
866 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
867 <xsl:value-of select="$newline" />
869 <xsl:apply-templates />
871 <xsl:value-of select="$newline" />
873 <xsl:call-template name="navigation-bar" />
875 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
878 <!-- ~~~~~~~~~~~~~ third-level-mainmatter-separate ~~~~~~~~~~~~~~ -->
880 <xsl:when test="$document-type='third-level-mainmatter-separate'">
881 <div class="mainmatter"><xsl:value-of select="$newline" />
882 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
883 <xsl:value-of select="$newline" />
885 <xsl:apply-templates />
887 <xsl:value-of select="$newline" />
889 <xsl:call-template name="navigation-bar" />
891 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
894 <!-- ~~~~~~~~~~~~~~~~ second-level-glossary ~~~~~~~~~~~~~~~~~~~ -->
896 <xsl:when test="$document-type='second-level-glossary'">
897 <div class="mainmatter"><xsl:value-of select="$newline" />
898 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
899 <xsl:value-of select="$newline" />
901 <xsl:apply-templates />
903 <xsl:value-of select="$newline" />
905 <xsl:call-template name="alpha-bar">
906 <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
909 <xsl:call-template name="navigation-bar" />
911 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
914 <!-- ~~~~~~~~~~~~~ third-level-glossary-separate ~~~~~~~~~~~~~~ -->
916 <xsl:when test="$document-type='third-level-glossary-separate'">
917 <div class="glossary"><xsl:value-of select="$newline" />
918 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
919 <xsl:call-template name="alpha-bar">
920 <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
923 <xsl:value-of select="$newline" />
925 <xsl:apply-templates />
927 <xsl:value-of select="$newline" />
929 <xsl:call-template name="navigation-bar" />
930 <xsl:value-of select="$newline" />
931 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
934 <!-- ~~~~~~~~~~~~~~~~~~ second-level-numbered ~~~~~~~~~~~~~~~~~~~~ -->
936 <xsl:when test="$document-type='second-level-numbered'">
937 <div class="frontmatter"><xsl:value-of select="$newline" />
938 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
939 <xsl:value-of select="$newline" />
942 <xsl:for-each select="data/section">
943 <xsl:if test="position() mod 50 = 1">
945 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="position()" /></xsl:attribute>
946 <xsl:value-of select="position()" /><xsl:text> - </xsl:text>
948 <xsl:when test="position() + 49 <= last()">
949 <xsl:value-of select="position() + 49" />
952 <xsl:value-of select="last()" />
955 </a><br /><xsl:value-of select="$newline" />
960 <xsl:value-of select="$newline" />
961 <xsl:value-of select="$newline" />
965 <xsl:value-of select="$newline" />
966 <xsl:value-of select="$newline" />
968 <xsl:for-each select="data/section">
969 <xsl:if test="position() mod 10 = 1">
972 <xsl:attribute name="name"><xsl:value-of select="position()" /></xsl:attribute>
973 <xsl:value-of select="position()" /><xsl:text> - </xsl:text>
975 <xsl:when test="position() + 9 <= last()">
976 <xsl:value-of select="position() + 9" />
979 <xsl:value-of select="last()" />
983 </h3><xsl:value-of select="$newline" />
984 <xsl:text disable-output-escaping="yes"><p class="center"><tt>[</xsl:text>
987 <xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
988 <xsl:value-of select="meta/title[1]" />
991 <xsl:when test="position() mod 10 = 0">
992 <xsl:text disable-output-escaping="yes">]</tt></p></xsl:text>
993 <xsl:value-of select="$newline" />
994 <xsl:value-of select="$newline" />
997 <xsl:text>|</xsl:text>
1002 <xsl:value-of select="$newline" />
1003 <xsl:value-of select="$newline" />
1005 <xsl:call-template name="navigation-bar" />
1006 <xsl:value-of select="$newline" />
1007 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1010 <!-- ~~~~~~~~~~~~~~~~~~ third-level-numbered ~~~~~~~~~~~~~~~~~~~~~ -->
1012 <xsl:when test="$document-type='third-level-numbered'">
1013 <div class="numbered"><xsl:value-of select="$newline" />
1014 <h3><xsl:value-of select="meta/title" /></h3><xsl:value-of select="$newline" />
1015 <xsl:value-of select="$newline" />
1017 <xsl:apply-templates />
1019 <xsl:value-of select="$newline" />
1020 <xsl:call-template name="navigation-bar" />
1021 <xsl:value-of select="$newline" />
1025 <!-- ~~~~~~~~~~~~~~~~~ second-level-backmatter ~~~~~~~~~~~~~~~~~~~ -->
1027 <xsl:when test="$document-type='second-level-backmatter'">
1028 <div class="frontmatter"><xsl:value-of select="$newline" />
1029 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1031 <xsl:value-of select="$newline" />
1032 <xsl:value-of select="$newline" />
1034 <xsl:apply-templates />
1036 <xsl:value-of select="$newline" />
1038 <xsl:call-template name="navigation-bar" />
1039 <xsl:value-of select="$newline" />
1040 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1043 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ map-adjusted ~~~~~~~~~~~~~~~~~~~~~~~~ -->
1045 <xsl:when test="$document-type='map-adjusted'">
1046 <div class="frontmatter"><xsl:value-of select="$newline" />
1047 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1049 <xsl:value-of select="$newline" />
1050 <xsl:value-of select="$newline" />
1052 <xsl:for-each select="data/* | data/text()">
1054 <xsl:when test="self::illustration">
1055 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1056 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1057 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1059 <xsl:variable name="illustration-width-adjusted"><xsl:number value="386" /></xsl:variable>
1060 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height * $illustration-width-adjusted div $illustration-width" /></xsl:variable>
1064 <!-- <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1065 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1066 <tr><xsl:value-of select="$newline" />
1067 <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1068 <td><img src="brdrtp.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1069 <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1070 </tr><xsl:value-of select="$newline" />
1071 <tr><xsl:value-of select="$newline" />
1072 <td><img src="brdrl.gif" width="31" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1073 <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" />
1074 <td><img src="brdrr.gif" width="33" height="{$illustration-height-adjusted}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1075 </tr><xsl:value-of select="$newline" />
1076 <tr><xsl:value-of select="$newline" />
1077 <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1078 <td><img src="brdrbt.gif" width="{$illustration-width-adjusted}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1079 <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1080 </tr><xsl:value-of select="$newline" />
1081 </table><xsl:value-of select="$newline" />
1083 </div></div><xsl:value-of select="$newline" /> -->
1086 <xsl:apply-templates select="." />
1091 <xsl:value-of select="$newline" />
1093 <xsl:call-template name="navigation-bar" />
1094 <xsl:value-of select="$newline" />
1098 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1100 <xsl:when test="$document-type='map'">
1101 <div class="frontmatter"><xsl:value-of select="$newline" />
1102 <h2><xsl:value-of select="meta/title" /></h2><xsl:value-of select="$newline" />
1104 <xsl:value-of select="$newline" />
1105 <xsl:value-of select="$newline" />
1107 <xsl:for-each select="data/* | data/text()">
1109 <xsl:when test="self::illustration">
1110 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1111 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1112 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1116 <!-- <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1117 <table border="0" cellpadding="0" cellspacing="0"><xsl:value-of select="$newline" />
1118 <tr><xsl:value-of select="$newline" />
1119 <td><img src="brdrtpl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1120 <td><img src="brdrtp.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1121 <td><img src="brdrtpr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1122 </tr><xsl:value-of select="$newline" />
1123 <tr><xsl:value-of select="$newline" />
1124 <td><img src="brdrl.gif" width="31" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1125 <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" />
1126 <td><img src="brdrr.gif" width="33" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1127 </tr><xsl:value-of select="$newline" />
1128 <tr><xsl:value-of select="$newline" />
1129 <td><img src="brdrbtl.gif" width="31" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1130 <td><img src="brdrbt.gif" width="{$illustration-width}" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1131 <td><img src="brdrbtr.gif" width="33" height="32" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1132 </tr><xsl:value-of select="$newline" />
1133 </table><br /><xsl:value-of select="$newline" />
1134 </div></div><xsl:value-of select="$newline" />-->
1137 <xsl:apply-templates select="." />
1142 <xsl:value-of select="$newline" />
1144 <xsl:call-template name="navigation-bar" />
1145 <xsl:value-of select="$newline" />
1149 <!-- ~~~~~~~~~~~~~~~~~~~~~~ illustration ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1151 <xsl:when test="$document-type='illustration'">
1152 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
1153 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
1154 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
1157 <xsl:text>Illustration </xsl:text>
1158 <xsl:number count="illustration[@class='float']" from="/" level="any" format="I" />
1159 </h3><xsl:value-of select="$newline" />
1161 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1162 <p><img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" align="middle" border="0" alt="[illustration]" /></p><xsl:value-of select="$newline" />
1163 </div></div><xsl:value-of select="$newline" />
1164 <p class="caption"><strong><xsl:apply-templates select="meta/description" /></strong></p><xsl:value-of select="$newline" />
1167 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1171 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1172 <xsl:value-of select="$document-type" />
1173 <xsl:text>".</xsl:text>
1176 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1177 <xsl:value-of select="$document-type" />
1178 <xsl:text>".</xsl:text>
1184 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1186 <xsl:call-template name="process-footnotes" />
1188 <p class="copyright"><xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" /></p><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1190 </div><xsl:value-of select="$newline" />
1192 <map name="imagemap" id="imagemap">
1193 <area shape="rect" coords="0,0,99,99" href="http://www.projectaon.org/" alt="Project Aon" />
1194 <area shape="default" href="title.htm" alt="The Masters of Darkness" />
1199 <xsl:value-of select="$newline" />
1200 <xsl:value-of select="$newline" />
1207 <xsl:template name="process-footnotes">
1208 <xsl:if test="footnotes/footnote">
1209 <div id="footnotes"><xsl:value-of select="$newline" />
1210 <xsl:for-each select="footnotes/footnote">
1211 <xsl:variable name="footnote-idref" select="@idref" />
1212 <xsl:variable name="footnote-id" select="@id" />
1213 <xsl:variable name="footnote-marker"><xsl:number count="footnotes/footnote" from="/" level="any" format="1" /></xsl:variable>
1215 <xsl:for-each select="*[1]">
1217 <xsl:text>[</xsl:text>
1218 <a href="#{$footnote-idref}" name="{$footnote-id}"><xsl:value-of select="$footnote-marker" /></a>
1219 <xsl:text>] </xsl:text>
1220 <xsl:apply-templates select="child::* | child::text()" />
1224 <xsl:for-each select="*[position() != 1]">
1225 <xsl:apply-templates select="." />
1228 </div><xsl:value-of select="$newline" />
1232 <xsl:template name="navigation-bar">
1233 <div class="navigation">
1234 <table cellspacing="0" cellpadding="0" border="0">
1238 <xsl:when test="meta/link[@class='prev']">
1240 <xsl:attribute name="href">
1241 <xsl:value-of select="meta/link[@class='prev']/@idref" />
1242 <xsl:text>.htm</xsl:text>
1244 <img src="back.gif" width="150" height="30" border="0">
1245 <xsl:attribute name="alt">
1246 <xsl:value-of select="id( meta/link[@class='prev']/@idref )/meta/title" />
1252 <img src="left.gif" width="150" height="30" border="0" alt="" />
1256 <td><a href="toc.htm"><img src="toc.gif" width="150" height="30" border="0" alt="" /></a></td>
1259 <xsl:when test="meta/link[@class='next']">
1261 <xsl:attribute name="href">
1262 <xsl:value-of select="meta/link[@class='next']/@idref" />
1263 <xsl:text>.htm</xsl:text>
1265 <img src="forward.gif" width="150" height="30" border="0">
1266 <xsl:attribute name="alt">
1268 <xsl:when test="$next-id = 'sect1'">
1269 <xsl:text>Section 1</xsl:text>
1272 <xsl:value-of select="id( meta/link[@class='next']/@idref )/meta/title" />
1280 <img src="right.gif" width="150" height="30" border="0" alt="" />
1289 <xsl:template name="alpha-bar">
1290 <xsl:param name="alpha-bar-id-prefix"></xsl:param>
1292 <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" />