Skip to content

Instantly share code, notes, and snippets.

@dcnb
Created June 8, 2015 21:23
Show Gist options
  • Save dcnb/e6b9d0967ac77ebf5738 to your computer and use it in GitHub Desktop.
Save dcnb/e6b9d0967ac77ebf5738 to your computer and use it in GitHub Desktop.
XSL stylesheet for producing interviwee page
<?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" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="text"/>
<xsl:output method="html" indent="yes" name="html"/>
<xs:element name="//date" type="xs:date"/>
<xsl:template match="/">
<xsl:for-each select="//person">
<xsl:variable name="filename" select="concat('people/', lower-case(page))"/>
<xsl:variable name="name" select="name"/>
<xsl:value-of select="$filename"/>
<!-- Creating -->
<xsl:result-document href="{$filename}" format="html">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>
<xsl:value-of select="substring-after($name, ', ')"/>
<xsl:text> </xsl:text>
<xsl:value-of
select="substring-before(concat(substring($name,1,1),
lower-case(substring($name, 2))), ', ')"/>
<xsl:text>- Latah Country Oral History Collection - University of Idaho Library Digital Initiatives</xsl:text>
</title>
<meta name="Keywords"
content="idaho, latah county, oral history, latah county historical society, forestry, logging, mining, 19th century, university of idaho, historical"/>
<meta name="Description"
content="In the mid 1970s, the Latah County Historical Society collected over 300 oaral histories from local Northern Idaho residents who grew up in Idaho during the early part of the 20th century. The Latah County Oral History Project produced one of the largest collections of oral histories in the Pacific Northwest. A copy of the transcripts and cassette recordings was donated to the University of Idaho Library in 1987. Those items were digitized and uploaded into our database in 2013. "/>
<link href="/digital/lcoh/people/css/viewer.css" rel="stylesheet"
type="text/css"/>
<link href="/digital/master_photo_collections.css" rel="stylesheet"
type="text/css"/>
<link href="http://fonts.googleapis.com/css?family=Oswald:400,300"
rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"/>
<style>
.digint a{
margin-top:10px;
}
.smalltitle{
margin-left:4px;
}
.intlist{
margin-left:5%;
width:80%;
}
.intlist h2{
text-align:left;
}
.underline{
text-decoration:underline;
}
.info,
.info2{
font-size:inherit;
margin-right:4px;
}
.smalltitleh3{
margin-left:4px;
font-size:15px;
}
.infoint,
#secondaryMetaData{
max-width:75%;
margin-left:15px;
font-weight:300;
}
.left_display{
float:left;
width:62%;
}
.right_display{
float:right;
width:32%;
margin-left:8%;
margin-bottom:100%;
}
.right_display img{
float:left;
max-width:350px;
width:100%;
}
.right_display p{
width:100%;
float:none;
text-align:center;
font-decoration:italic;
}
.year{
margin-top:-9px;
min-width:250px;
}</style>
</head>
<body>
<div class="box1">
<div class="diginit">
<a id="digleft" href="http://www.lib.uidaho.edu/digital/index.html"
title="University of Idaho Library Digital Initiatives">
<img id="digleft"
src="http://www.lib.uidaho.edu/digital/justdi_logo_sm.png"
alt="digital initiatives logo"
style="margin: 13px 0 2.5px 0%;"/>
</a>
<a href="http://www.lib.uidaho.edu"
title="University of Idaho Library">
<img id="libleft"
src="http://www.lib.uidaho.edu/digital/justlib_logo_sm.png"
alt="library logo"/>
</a>
</div>
<div id="title">
<h2>
<a href="/digital/lcoh/index.html"
style="border:none;color:inherit;text-decoration:none;font-size:inherit;"
>Latah County Oral History Collection</a>
</h2>
<p>Remembering Latah County and Idaho Life at the turn of the 20th
century </p>
</div>
</div>
<xsl:comment>#include virtual="/digital/collectionspull.txt"</xsl:comment>
<div class="box2">
<div class="nav2">
<a href="/digital/lcoh/index.html" id="">Home</a>
<a href="/digital/lcoh/about.html" id="">About</a>
<a href="/digital/lcoh/locations.html" id="">Locations</a>
<a href="/digital/lcoh/map.html" id="">Map</a>
<a href="/digital/lcoh/people/" id="" class="select">People</a>
<a href="/digital/lcoh/subjects.html" id="">Subjects</a>
<a href="http://digital.lib.uidaho.edu/cdm/search/collection/latah"
id="allhash">Database</a>
</div>
<div class="searchall" style="margin-bottom:-1px;">
<form action="http://digital.lib.uidaho.edu/cdm4/results.php"
method="get">
<input type="hidden" value="all" name="CISOOP1"/>
<input type="text" size="15" name="CISOBOX1"/>
<input type="hidden" value="CISOSEARCHALL" name="CISOFIELD1"/>
<input type="hidden" value="exaxt" name="CISOOP2"/>
<input type="hidden" value="" name="CISOBOX2"/>
<input type="hidden" value="CISOSEARCHALL" name="CISOFIELD2"/>
<input type="hidden" value="any" name="CISOOP3"/>
<input type="hidden" value="" name="CISOBOX3"/>
<input type="hidden" value="CISOSEARCHALL" name="CISOFIELD3"/>
<input type="hidden" value="none" name="CISOOP4"/>
<input type="hidden" value="" name="CISOBOX4"/>
<input type="hidden" value="CISOSEARCHALL" name="CISOFIELD4"/>
<input type="hidden" value="/latah" name="CISOROOT"/>
<input class="button-all" type="submit" value=" Search "/>
</form>
</div>
</div>
<xsl:comment>#include virtual="/digital/lcoh/peoplelist.html" </xsl:comment>
<!-- Page Content - Isotope Cascading Images -->
<div class="box3">
<xsl:attribute name="style">
<xsl:choose>
<xsl:when test="Photo = ''"> </xsl:when>
<xsl:otherwise>
<xsl:text>min-height:1000px;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<div id="slideshow">
<div class="larrow">
<a id="leftarrow" class="arrow" onkeydown="leftArrowPressed()"
title="Previous Person">
<xsl:attribute name="href"
><xsl:text>/digital/lcoh/people/</xsl:text><xsl:value-of
select="lower-case(prev)"/></xsl:attribute> &lt;
</a>
</div>
<div class="larrowinfo">
<a id="leftarrow" class="arrow" onkeydown="leftArrowPressed()"
title="Previous Person">
<xsl:attribute name="href"
><xsl:text>/digital/lcoh/people/</xsl:text><xsl:value-of
select="lower-case(prev)"/></xsl:attribute>
Previous<br/>Person </a>
</div>
<div class="rarrow">
<a id="rightarrow" class="arrow" onkeydown="rightArrowPressed()"
title="Next Oral History">
<xsl:attribute name="href"
><xsl:text>/digital/lcoh/people/</xsl:text><xsl:value-of
select="lower-case(next)"/></xsl:attribute> &gt;
</a>
</div>
<div class="rarrowinfo">
<a id="rightarrow" class="arrow" onkeydown="rightArrowPressed()"
title="Next Oral History">
<xsl:attribute name="href"
><xsl:text>/digital/lcoh/people/</xsl:text><xsl:value-of
select="lower-case(next)"/></xsl:attribute>
Next<br/>Person </a>
</div>
</div>
<div class="right_display">
<xsl:choose>
<xsl:when test="Photo = ''"/>
<xsl:otherwise>
<a>
<xsl:attribute name="href">
<xsl:text>/digital/lcoh/photos/large/</xsl:text>
<xsl:value-of select="Photo"/>
<xsl:text>_lg.jpg</xsl:text>
</xsl:attribute>
<img class="lcohphoto">
<xsl:attribute name="src">
<xsl:text>/digital/lcoh/photos/</xsl:text>
<xsl:value-of select="Photo"/>
<xsl:text>.jpg</xsl:text>
</xsl:attribute>
</img>
</a>
<div style="clear:both"/>
<p>(click to see larger image) </p>
</xsl:otherwise>
</xsl:choose>
<br/>
<a href="../map.html">
<img>
<xsl:attribute name="src">
<xsl:text>http://maps.google.com/maps/api/staticmap?center=46.826786, -116.697019&amp;zoom=9&amp;size=350x300&amp;maptype=terrain&amp;sensor=false&amp;language=&amp;markers=color:red|label:LatahCounty|</xsl:text>
<xsl:for-each select="record/locations/lat">
<xsl:value-of select="."/>
<xsl:text>|</xsl:text>
</xsl:for-each>
</xsl:attribute>
</img>
</a>
<div style="clear:both"/>
<p> Related Locations (click to visit map) </p>
</div>
<div class="left_display;">
<h1>
<xsl:value-of select="substring-after($name, ', ')"/><xsl:text> </xsl:text><xsl:value-of select="substring-before($name, ', ')"/>
<span class="smalltitle">(b. <xsl:value-of select="birthyear"/>)</span>
</h1>
<h3 id="secondaryMetaData">
<span class="info">Residence:</span><xsl:value-of select="residence"/> <span class="info2">Occupation(s):</span><xsl:value-of select="occupation"/><br/>
<span class="info">Family Origin:</span><xsl:value-of select="origin"/></h3>
<div class="intlist">
<h2 class="underline left">Interviews</h2>
<xsl:for-each select="record"><h3>
<xsl:choose>
<xsl:when test="version = 'intonly'">
<a target="_blank"><xsl:attribute name="href"><xsl:text>http://digital.lib.uidaho.edu/utils/getfile/collection/latah/id/</xsl:text>
<xsl:value-of select="file_name"/><xsl:text>/filename/</xsl:text><xsl:value-of select="../lastname"/>
<xsl:value-of select="replace(intnum, 'Interview #', '')"/><xsl:text>.pdf</xsl:text></xsl:attribute>
<xsl:value-of select="intnum"/>, <xsl:value-of select="date"/><xsl:text> (transcript only)</xsl:text></a>
</xsl:when>
<xsl:otherwise>
<a><xsl:attribute name="href">/digital/lcoh/people/interviews/viewer.php?cachefile=<xsl:value-of select="disp_name"/>.xml</xsl:attribute>
<xsl:value-of select="intnum"/>, <xsl:value-of select="date"/></a>
</xsl:otherwise>
</xsl:choose>
</h3>
<p class="infoint">
<span class="info">Topics:</span> <xsl:value-of select="description"/><br/>
<span class="info">Duration:</span><xsl:value-of select="duration"/>
<span class="info2">Interviewer:</span><xsl:value-of select="interviewer"/>
<br/>
<span class="info">Keywords:</span>
<xsl:for-each select="keywords/keyword">
<a><xsl:attribute name="class"><xsl:text>vocab </xsl:text><xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="data-filter"><xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="href">/digital/lcoh/index.html#<xsl:value-of select="."/></xsl:attribute>
<xsl:value-of select="."/></a>
<xsl:text> </xsl:text>
</xsl:for-each>
<br/>
<span class="info">Locations:</span>
<xsl:for-each select="locations/location">
<a><xsl:attribute name="class"><xsl:text>vocab </xsl:text><xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="data-filter"><xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="href">/digital/lcoh/index.html#<xsl:value-of select="."/></xsl:attribute>
<xsl:value-of select="."/>
</a>
<xsl:text> </xsl:text>
</xsl:for-each>
</p>
</xsl:for-each>
</div>
</div>
</div>
<script type="text/javascript">
function leftArrowPressed() {
location.href = document.getElementById("leftarrow").href;
}
function rightArrowPressed() {
location.href = document.getElementById("rightarrow").href;
}
document.onkeydown = function(evt) {
evt = evt || window.event;
switch (evt.keyCode) {
case 37:
leftArrowPressed();
break;
case 39:
rightArrowPressed();
break;
}
}; </script>
<xsl:comment>#include virtual="/digital/digitalanalytics.txt"</xsl:comment>
</body>
</html>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment