-
Notifications
You must be signed in to change notification settings - Fork 11
/
htm-teiterm.xsl
48 lines (43 loc) · 2.31 KB
/
htm-teiterm.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:template match="t:term">
<xsl:param name="parm-edn-structure" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-hgv-gloss" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:choose>
<!-- Adds caption for hgv translations -->
<xsl:when test="($parm-leiden-style = ('ddbdp','dclp','sammelbuch')) and ancestor::t:div[@type = 'translation'] and @target">
<xsl:variable name="lang" select="ancestor::t:div[@type = 'translation']/@xml:lang"/>
<xsl:variable name="term" select="@target"/>
<xsl:choose>
<xsl:when test="ancestor::t:lem">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="document($parm-hgv-gloss)//t:item[@xml:id = $term]/t:gloss[@xml:lang = $lang]/text()"><span class="term">
<xsl:apply-templates/>
<span class="gloss" style="display:none"><xsl:value-of select="document($parm-hgv-gloss)//t:item[@xml:id = $term]/t:gloss[@xml:lang = $lang]"/></span>
</span></xsl:when>
<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$parm-edn-structure = 'rib'">
<xsl:choose>
<xsl:when test="@xml:lang='grc'"><span class="greek"><xsl:apply-templates/></span></xsl:when>
<xsl:when test="@rend='diplo'"><span class="sc"><xsl:apply-templates/></span></xsl:when>
<xsl:when test="@xml:lang"><span class="em"><xsl:apply-templates/></span></xsl:when>
<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>