-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteihi.xsl
66 lines (64 loc) · 3.37 KB
/
teihi.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
65
66
<?xml version="1.0" encoding="UTF-8"?>
<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">
<!-- html hi part of transformation in htm-teihi.xsl -->
<xsl:template match="t:hi">
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:choose>
<xsl:when test="@rend='ligature'">
<xsl:choose>
<xsl:when test="$parm-leiden-style = 'rib'">
<xsl:choose>
<xsl:when test="string-length(normalize-space(.))=2"><xsl:value-of select="substring(.,1,1)"/><xsl:text>͡</xsl:text><xsl:value-of select="substring(.,2,1)"/></xsl:when>
<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$parm-leiden-style='seg'">
<xsl:if test="string-length(normalize-space(.))=2">
<xsl:text>͜</xsl:text>
</xsl:if>
</xsl:if>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when
test="@rend = 'diaeresis' or @rend = 'grave' or @rend = 'acute' or @rend = 'asper' or @rend = 'lenis' or @rend = 'circumflex'">
<xsl:apply-templates/>
<xsl:choose>
<!-- if context is inside the app-part of an app-like element, print diacritic in parens here -->
<xsl:when test="$parm-apparatus-style = 'ddbdp' and
ancestor::t:*[local-name()=('reg','corr','rdg')
or self::t:del[@rend='corrected']]">
<!--ancestor::t:*[local-name()=('orig','reg','sic','corr','lem','rdg')
or self::t:del[@rend='corrected']
or self::t:add[@place='inline']][1][local-name()=('reg','corr','del','rdg')]">-->
<xsl:text>(</xsl:text>
<!-- found in tpl-apparatus.xsl -->
<xsl:call-template name="hirend">
<xsl:with-param name="hicontext" select="'no'"/>
</xsl:call-template>
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:when test="$parm-apparatus-style = 'ddbdp'">
<!-- found in [htm|txt]-tpl-apparatus.xsl -->
<xsl:call-template name="app-link">
<xsl:with-param name="location">
<xsl:choose>
<xsl:when test="$location = 'apparatus'">apparatus</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>