2007-07-16 22:27:55 -04:00
|
|
|
<?xml version='1.0'?>
|
|
|
|
|
2007-08-11 04:26:38 -04:00
|
|
|
<xsl:stylesheet version="2.0"
|
2007-08-11 05:24:19 -04:00
|
|
|
xmlns="http://www.w3.org/1999/xhtml"
|
2007-08-11 04:26:38 -04:00
|
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
2007-08-12 16:06:22 -04:00
|
|
|
xmlns:fn="http://www.w3.org/2005/xpath-functions"
|
2007-08-11 04:26:38 -04:00
|
|
|
xmlns:csc="http://www.csclub.uwaterloo.ca/xslt">
|
2007-07-16 22:27:55 -04:00
|
|
|
|
|
|
|
<xsl:template match="all-books">
|
|
|
|
<p>The books we currently own include:</p>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>Title</th>
|
|
|
|
<th>Author</th>
|
|
|
|
</tr>
|
2007-08-11 04:26:38 -04:00
|
|
|
<xsl:for-each select="document(concat($g_root, '/books.xml'))/booklist/book">
|
2007-07-16 22:27:55 -04:00
|
|
|
<xsl:variable name="class">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="position() mod 2 = 0">books1</xsl:when>
|
|
|
|
<xsl:otherwise>books2</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:variable>
|
|
|
|
<tr class="{$class}" >
|
|
|
|
<td>
|
|
|
|
<a href="{$pre}office/books/{translate(@isbn, ' ', '_')}.html">
|
|
|
|
<xsl:value-of select="@title" />
|
|
|
|
<xsl:if test="@edition != ''">
|
|
|
|
(<xsl:value-of select="@edition" />)
|
|
|
|
</xsl:if>
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<xsl:value-of select="@author" />
|
|
|
|
</td>
|
|
|
|
</tr>
|
2007-08-11 04:26:38 -04:00
|
|
|
<xsl:result-document method="xml" encoding="ISO-8859-1"
|
2007-07-16 22:27:55 -04:00
|
|
|
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
|
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
2007-08-11 04:26:38 -04:00
|
|
|
href="{translate(concat($g_root, '/office/books/', @isbn, '.html'), ' ', '_')}">
|
2007-07-16 22:27:55 -04:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Book: <xsl:value-of select="@title" /></title>
|
|
|
|
<link rel="stylesheet" href="{$pre}default.css" type="text/css" />
|
|
|
|
</head>
|
|
|
|
<body><div>
|
2007-08-11 04:26:38 -04:00
|
|
|
<xsl:call-template name="header" />
|
2007-07-16 22:27:55 -04:00
|
|
|
<p>
|
|
|
|
<b>Title: </b> <xsl:value-of select="@title" /><br />
|
|
|
|
<b>Edition: </b> <xsl:value-of select="@edition" /><br />
|
|
|
|
<b>ISBN: </b> <xsl:value-of select="@isbn" /><br />
|
|
|
|
<b>Author: </b> <xsl:value-of select="@author" /><br />
|
|
|
|
<b>Published: </b> <xsl:value-of select="@published" /><br />
|
|
|
|
</p>
|
|
|
|
<xsl:call-template name="footer" />
|
|
|
|
</div></body>
|
|
|
|
</html>
|
2007-08-11 04:26:38 -04:00
|
|
|
</xsl:result-document>
|
2007-07-16 22:27:55 -04:00
|
|
|
</xsl:for-each>
|
|
|
|
</table>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|