<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">

<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="toc.css" />
</head>
<body>

<div class="container">

<div class="head">
<div class="updates">
<a href="http://www.gearseds.com/book/updates.html">Click Here to Check for Updates!</a>
</div>
<img src="logo.gif" class="logo" />
<br /><br />Table of Contents
</div>		
			<div class="list_chapters_index">
				<div class="list_media_index">
					<font class="title">Media Indexes</font><br />
					<xsl:apply-templates select="toc/media" />
				</div>
				<font class="title">Chapters</font><br />
				<xsl:apply-templates select="toc/chapters" />
			</div>

		<div id="foot"> </div>
</div>

</body>
</html>

</xsl:template>

<xsl:template match="chapters">
		<xsl:for-each select="chapteritem">
			<xsl:sort select="@id" />
			<xsl:apply-templates select="filename" /><br />
		</xsl:for-each>
</xsl:template>

<xsl:template match="toc/chapters/chapteritem/filename">
<xsl:value-of select="../@id" />  <xsl:text> </xsl:text>
<a href="{@xlink:href}" class="chapter"><xsl:value-of select="child::text()" /></a>
</xsl:template>

<xsl:template match="toc/media">
	<xsl:for-each select="mediaitem">
		<a href="{filename/@xlink:href}" class="media"><xsl:value-of select="filename" /></a><br />
	</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
