Listing 1
<?xml version="1.0"?>
<!--
Author: Mark Miller
Contact: mark.miller@techtrainingworkshop.com
Basic pagination script: http://www.bayes.co.uk/xml/
Date: March 2003
Note: Please consider sending me any changes you make to
the file so that I can include them in future updates.
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" indent="no"/>
<xsl:param name="pagenumber" select="1"/>
<!-- ***** MASTER PAGE FORMAT ***** -->
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="topic/metadata/
presentation/event"/></title>
<!-- PATHS SHOULD BE RELATIVE TO THE XML FILE,
NOT THE XSL FILE -->
<script language="javascript"
src="../resources/clientSidePagination.js"/>
<link rel="stylesheet" type="text/css"
href="../resources/clientSidePagination.css"/>
</head>
<body onLoad="window.status='{topic/title}'; return
true;">
<!-- SELECT THE PAGES -->
<xsl:apply-templates select="topic/page
[$pagenumber]">
<xsl:with-param name="element" select="'page'" />
<xsl:with-param name="pagenumber"
select="$pagenumber" />
</xsl:apply-templates>
<!-- NAVIGATION -->
<xsl:call-template name="navigation">
<xsl:with-param name="element" select="'page'" />
<xsl:with-param name="pagenumber"
select="$pagenumber" />
</xsl:call-template>
<!-- COPYRIGHT -->
<xsl:apply-templates select="topic"/>
</body>
</html>
</xsl:template>
...
</xsl:stylesheet>
Listing 2
<?xml version="1.0"?>
<!--
Author: Mark Miller
Contact: mark.miller@techtrainingworkshop.com
Basic pagination script: http://www.bayes.co.uk/xml/
Date: March 2003
Note: Please consider sending me any changes you make to
the file so that I can include them in future updates.
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" indent="no"/>
<xsl:param name="pagenumber" select="1"/>
<!-- ***** MASTER PAGE FORMAT ***** -->
<xsl:template match="/">
...
</xsl:template>
<!-- **** NAVIGATION: BOTTOM OF PAGE **** -->
<xsl:template name="navigation">
<xsl:param name="element" />
<xsl:param name="pagenumber" />
<xsl:variable name="total" select="count(topic/*[name()
= $element])" />
<!-- UNCOMMENT FOR TESTING
Page Number: <xsl:value-of
select="$pagenumber"/><br/>
Element Name: <xsl:value-of select="$element" /><br/>
Total number of pages in this topic: <xsl:value-of
select="$total"/>
-->
<!-- RESTRICT DISPLAY TO 600 PIXELS -->
<table width="600" border="0" align="center">
<tr>
<td align="right">
<a href="javascript:window.close();">Close
Window</a>
</td>
</tr>
<tr>
<td>
<div class="navbar">
<table border="0" width="600" cellpadding="0"
cellspacing="0" class="tableColor">
<tr>
<!-- BACK BUTTON -->
<td align="left" width="10%">
<xsl:if test="$pagenumber > 1">
<a onMouseOver="navigationInfo('Go back one
page in this section'); return true;"
onMouseOut="showPageInfo('Currently on
Page {$pagenumber}'); return true;"
href="JavaScript:changePage({$pagenumber
-1});">
<span class="arrowsBottom">3</span><span
class="directionWord">Back</span></a>
</xsl:if><br/>
</td>
<!-- PAGE NUMBERS WITH LINKS -->
<td align="center"><span
class="navbarText">Jump to Page: </span>
<xsl:for-each select="topic/*[name() =
$element]">
<xsl:variable name="currentNumber"
select="count(preceding-sibling::page)+1"/>
<xsl:choose>
<xsl:when test="not($currentNumber =
$pagenumber)">
 <a onMouseOver="navigationIn
fo('Page {$currentNumber}:
{title}'); return true;"
onMouseOut="showPageInfo('Currently on Page {$pagenumber}');
return true;"
href="JavaScript:changePage({$currentNumber});">
<xsl:value-of select=
"$currentNumber" /></a>
</xsl:when>
<xsl:otherwise>
 <span
class="currentPage"><xsl:text>
</xsl:text><xsl:value-of
select="$currentNumber" /><xsl:text>
</xsl:text></span>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
<!-- NEXT BUTTON -->
<td align="right" width="10%">
<xsl:if test="$pagenumber < $total">
<a onMouseOut="showPageInfo('Currently on
Page {$pagenumber}'); return true;"
onMouseOver="navigationInfo('Go to the
next page in this section'); return
true;"
href="JavaScript:changePage
({$pagenumber +1});">
<span class="directionWord">
Next</span>
<span class="arrowsBottom">4</span></a>
</xsl:if><br/>
</td>
<!-- CLOSE HTML TABLE -->
</tr>
</table>
</div>
</td></tr></table>
</xsl:template>
...
</stylesheet>
Listing 3
<!-- XML file calling each of the presentation modules -->
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="../coursebuilder/clientSideToc.xsl"?>
<course>
<topic href="introduction.xml"/>
<topic href="creating-xml.xml"/>
<topic href="defining-dtd.xml"/>
<topic href="output-xslt.xml"/>
&footer;
</course>
<!-- XSL Snippet to Build TOC links-->
<xsl:for-each select="topic">
<div class="tocChapterTitle">
<a href="javascript:newWindow('{@href}')">
<xsl:value-of
select="document(@href)//topic/title"/>
</a>
</div>
</xsl:for-each>
Listing 4
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xsl"
href="../coursebuilder/clientSidePagination.xsl"?>
<!DOCTYPE topic [
<!ENTITY footer SYSTEM "metadata.xml">
<!ENTITY placebo "">
]>
<topic subject="xsl">
<!-- METADATA INFORMATION ABOUT THIS SESSION -->
&footer;
<!-- TITLE OF THIS SESSION -->
<title>Course Overview</title>
<!-- *********** PAGE ************ -->
<page subject="contents">
<title>Chapter Contents</title>
<heading>Introduction</heading>
</page>
<page subject="intro-materials">
<title>Format and Materials</title>
<talkingPoint>
<heading>Class Format</heading>
<outline>
<item>Short lecture and discussion of a relevant
point</item>
<item>Hands-on lab to practice utilizing the
point</item>
<item>Finished solution for each lab</item>
</outline>
</talkingPoint>
<talkingPoint>
<heading>Access to Materials</heading>
<outline>
<item>All materials are online</item>
<item>Code samples, resources and practice tools
<outline>
<item>download class <inlineLink href="code.exe">code
samples</inlineLink></item>
<item>save the file to your desktop</item>
<item>double click the 'code.exe' file that is stored
on the desktop</item>
<item>choose 'c/' as the location for 'Unzip to
folder' field</item>
<item>choose 'Unzip'</item>
</outline>
</item>
</outline>
</talkingPoint>
</page>
<page subject="intro-aboutme">
<title>About the Instructor</title>
<talkingPoint>
<heading>Who am I</heading>
<outline>
<item>Mark Miller</item>
<item>Corporate Trainer of Internet
Technologies</item>
<item>NYC, NY</item>
<item>mark.miller@TechTrainingWorkshop.com</item>
</outline>
</talkingPoint>
<image>
<src>../images/mark-vermont.jpg</src>
<width>300</width>
<height>217</height>
<border>1</border>
<alt>Stowe, Vermont... highest point in the state</alt>
</image>
</page>
</topic>