-
Notifications
You must be signed in to change notification settings - Fork 0
/
htm-teiref.xsl
48 lines (43 loc) · 1.71 KB
/
htm-teiref.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:t="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="t"
version="2.0">
<xsl:include href="teiref.xsl"/>
<xsl:template match="t:ref">
<xsl:choose>
<xsl:when test="@type = 'reprint-from'">
<br/>
<!-- Found in teiref.xsl -->
<xsl:call-template name="reprint-text">
<xsl:with-param name="direction" select="'from'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@type = 'reprint-in'">
<br/>
<!-- Found in teiref.xsl -->
<xsl:call-template name="reprint-text">
<xsl:with-param name="direction" select="'in'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@type = 'Perseus'">
<xsl:variable name="col" select="substring-before(@href, ';')"/>
<xsl:variable name="vol" select="substring-before(substring-after(@href,';'),';')"/>
<xsl:variable name="no" select="substring-after(substring-after(@href,';'),';')"/>
<a href="http://www.perseus.tufts.edu/cgi-bin/ptext?doc=Perseus:text:1999.05.{$col}:volume={$vol}:document={$no}">
<xsl:apply-templates/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="link-text">
<xsl:param name="href-link"/>
<xsl:param name="val-doc"/>
<a href="{$href-link}">
<xsl:value-of select="$val-doc"/>
</a>
</xsl:template>
</xsl:stylesheet>