-
-
Save richard-srnsw/7ae9c2f8605038f927b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"> | |
<xsl:output method="html"/> | |
<xsl:template match="/"> | |
<xsl:param name="pSortNameAuth" select="'authors'"/> | |
<xsl:param name="pSortNameYear" select="'dates'"/> | |
<xsl:param name="pSortNameTitle" select="'titles'"/> | |
<xsl:param name="pSortPosition" select="1"/> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | |
<head> | |
<title>Bibliography</title> | |
<script type="text/javascript"> | |
<xsl:text> | |
function reveal(target) { | |
if (target=='author') { | |
document.getElementById('publication').style.display = 'none'; | |
document.getElementById('title').style.display = 'none'; | |
document.getElementById('author').style.display = ''; | |
} | |
if (target=='publication') { | |
document.getElementById('author').style.display = 'none'; | |
document.getElementById('title').style.display = 'none'; | |
document.getElementById('publication').style.display = ''; | |
} | |
if (target=='title') { | |
document.getElementById('author').style.display = 'none'; | |
document.getElementById('publication').style.display = 'none'; | |
document.getElementById('title').style.display = ''; | |
} | |
} | |
</xsl:text> | |
</script> | |
</head> | |
<body> | |
<p>Sort by: <a href="#top" onclick="reveal('author')">Author</a> | <a href="#top" onclick="reveal('publication')">Year of publication</a> | <a href="#top" onclick="reveal('title')">Title</a></p> | |
<div id="author"> | |
<xsl:for-each select="//record"> | |
<xsl:sort select=".//*[name()=$pSortNameAuth]/*[position()=$pSortPosition]"/> | |
<xsl:apply-templates/> | |
</xsl:for-each> | |
</div> | |
<div id="publication" style="display: none"> | |
<xsl:for-each select="//record"> | |
<xsl:sort select=".//*[name()=$pSortNameYear]/*[position()=$pSortPosition]"/> | |
<xsl:apply-templates/> | |
</xsl:for-each> | |
</div> | |
<div id="title" style="display: none"> | |
<xsl:for-each select="//record"> | |
<xsl:sort select=".//*[name()=$pSortNameTitle]/*[position()=$pSortPosition]"/> | |
<xsl:apply-templates/> | |
</xsl:for-each> | |
</div> | |
</body> | |
</html> | |
</xsl:template> | |
<xsl:template match="record"> | |
<div class="record"> | |
<hr/> | |
<p><strong>Record Number: </strong> <xsl:value-of select="rec-number"/><br/><br/> | |
<xsl:value-of select="contributors/authors/author"/> | |
<xsl:text>. </xsl:text> | |
<em><xsl:value-of select="titles/title"/>. </em> | |
<xsl:value-of select="pub-location"/>: <xsl:value-of select="publisher"/>, <xsl:value-of select="dates/year"/>. <xsl:value-of select="pages"/> | |
</p> | |
</div> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment