forked from EpiDoc/Stylesheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
htm-teiref.xsl
64 lines (59 loc) · 2.84 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?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" mode="#default inslib-dimensions inslib-placename sample-dimensions medcyprus-location medcyprus-dimensions">
<xsl:param name="parm-edn-structure" tunnel="yes" required="no"/>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"/>
<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>
<!-- template specific rendering of t:ref should be moved here from the various htm-tpl-struct-xxx.xsl files -->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@target">
<a href="{@target}" target="_blank"><xsl:apply-templates/></a>
</xsl:when>
<xsl:when test="@corresp and not(@target)">
<a href="{@corresp}" target="_blank"><xsl:apply-templates/></a>
</xsl:when>
<xsl:when test="@type='inscription' and @n and not(@target) and not(@corresp)">
<a href="{@n}.html" target="_blank"><xsl:apply-templates/></a>
</xsl:when>
<xsl:when test="@type='inscription' and not(@n) and not(@target) and not(@corresp)">
<a target="_blank" href="{lower-case(translate(string(.), ' ', ''))}.html"><xsl:apply-templates/></a>
</xsl:when>
</xsl:choose>
</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>