www/xsl/media.xsl

105 lines
3.7 KiB
XML
Raw Normal View History

<?xml version='1.0'?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:csc="http://www.csclub.uwaterloo.ca/cow"
extension-element-prefixes="csc">
<xsl:template match="mediafile">
<xsl:param name="ext" />
<a href="/files/{@file}{$ext}"><xsl:value-of select="@type" /></a>,
</xsl:template>
<xsl:template match="flvfile">
<script type="text/javascript" src="flash/swfobject.js"></script>
<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">
Get the Flash Player</a> to see this video using Flash Player.</p>
<script type="text/javascript">
var s1 = new SWFObject("flash/flvplayer.swf","single","400","300","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("file","http://csclub.uwaterloo.ca/files/<xsl:value-of select="@file" />");
<xsl:if test="@preview">
s1.addVariable("image","http://csclub.uwaterloo.ca/files/<xsl:value-of select="@preview" />");
</xsl:if>
s1.write("player1");
</script>
</xsl:template>
<xsl:template match="mediaitem">
<xsl:document method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
href="{translate(concat($root, '/media/', @title , '.html'), ' ', ' ')}">
<html>
<head>
<title><xsl:value-of select="@title" /></title>
<link rel="stylesheet" href="{$pre}default.css" type="text/css" />
</head>
<body><div>
<xsl:call-template name="header">
<xsl:with-param name="title" select="@title" />
</xsl:call-template>
<xsl:if test="abstract">
<h2>Abstract</h2>
<div>
<xsl:apply-templates select="abstract/node()" />
</div>
</xsl:if>
<xsl:if test="flvfile">
<h2>View</h2>
<div>
<xsl:apply-templates select="flvfile" />
</div>
</xsl:if>
<xsl:if test="mediafile">
<h2>Download</h2>
<div><strong>
HTTP (web browser):
<xsl:apply-templates select="mediafile" />
<br/><br/>
BitTorrent:
<xsl:apply-templates select="mediafile" >
<xsl:with-param name="ext">.torrent</xsl:with-param>
</xsl:apply-templates>
</strong></div>
</xsl:if>
<br/>
<!-- AddThis Bookmark Button -->
<script type="text/javascript">
addthis_url = location.href;
addthis_title = document.title;
addthis_pub = 'calumt';
</script>
<script type="text/javascript"
src="http://s7.addthis.com/js/addthis_widget.php?v=12" />
<xsl:if test="@buttons">
<br/><br/>
<!-- digg button -->
<script src="http://digg.com/tools/diggthis.js"
type="text/javascript" />
<!-- reddit button -->
<script type="text/javascript"
src="http://reddit.com/button.js?t=3" />
</xsl:if>
<!-- google ads -->
<!--
<script type="text/javascript">
google_ad_client = "pub-5235744946475097";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-03-21: mcc
google_ad_channel = "1106187834";
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js" />
-->
<xsl:call-template name="footer" />
</div></body>
</html>
</xsl:document>
<li><a href= "{@title}.html"><xsl:value-of select="@title" /></a></li>
</xsl:template>
</xsl:stylesheet>