-
Notifications
You must be signed in to change notification settings - Fork 11
/
htm-teimilestone.xsl
106 lines (103 loc) · 4.89 KB
/
htm-teimilestone.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?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">
<!-- More specific templates in teimilestone.xsl -->
<xsl:template match="t:milestone">
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"/>
<xsl:param name="parm-edn-structure" tunnel="yes" required="no"/>
<xsl:choose>
<xsl:when
test="($parm-leiden-style = ('ddbdp','dclp','sammelbuch')) and ancestor::t:div[@type = 'translation']">
<xsl:if test="@rend = 'break'">
<br/>
</xsl:if>
<sup>
<strong>
<xsl:value-of select="@n"/>
</strong>
</sup>
<xsl:text> </xsl:text>
</xsl:when>
<xsl:when test="($parm-leiden-style = ('ddbdp','dclp','sammelbuch') or $parm-edn-structure='inslib')">
<xsl:choose>
<xsl:when test="@rend = 'wavy-line'">
<xsl:if test="not(parent::t:supplied)">
<br/>
</xsl:if>
<xsl:text>~~~~~~~~</xsl:text>
</xsl:when>
<xsl:when test="@rend = 'paragraphos'">
<!-- imported change from https://sourceforge.net/p/epidoc/code/2602/-->
<!-- Added to controll '-' when there is a milestone@rend='paragraphos' followed by a lb@break='no' see: https://github.com/DCLP/dclpxsltbox/issues/52-->
<xsl:if test="following-sibling::node()[not(self::text()
and normalize-space(self::text())='')][1]/self::t:lb[@break='no']
and not(preceding-sibling::*[1][self::t:supplied[@reason='lost']])">-</xsl:if>
<xsl:if test="not(parent::t:supplied) and not($parm-edn-structure='inslib')">
<br/>
</xsl:if>
<xsl:text>——</xsl:text>
</xsl:when>
<xsl:when test="@rend = 'diple-obelismene' and @unit='undefined'">
<!-- <xsl:message><xsl:text> </xsl:text>diple-obelismene!</xsl:message> -->
<xsl:if test="following-sibling::node()[not(self::text() and normalize-space(self::text())='')][1]/self::t:lb[@break='no']">-</xsl:if>
<xsl:if test="not(parent::t:supplied)">
<br/>
</xsl:if>
<xsl:text>⤚</xsl:text>
</xsl:when>
<xsl:when test="@rend = 'coronis' and @unit='undefined'">
<!-- <xsl:message><xsl:text> </xsl:text>coronis!</xsl:message> -->
<xsl:if test="following-sibling::node()[not(self::text() and normalize-space(self::text())='')][1]/self::t:lb[@break='no']">-</xsl:if>
<xsl:if test="not(parent::t:supplied)">
<br/>
</xsl:if>
<xsl:text>⸎</xsl:text>
</xsl:when>
<xsl:when test="@rend = 'horizontal-rule'">
<xsl:if test="not(parent::t:supplied)">
<br/>
</xsl:if>
<xsl:text>————————</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="$parm-leiden-style='medcyprus' and @unit=('column', 'surface')">
<xsl:text>|</xsl:text>
</xsl:when>
<xsl:otherwise>
<!-- same as @unit='fragment' or @unit='block' -->
<!-- adds pipe for block, flanked by spaces if not within word, and with @n as exposant if exists -->
<xsl:if test="not(ancestor::t:w)">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:text>|</xsl:text>
<xsl:if test="@n">
<sup><xsl:value-of select="@n"/></sup>
</xsl:if>
<xsl:if test="not(ancestor::t:w)">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="t:cb">
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"/>
<xsl:if test="$parm-leiden-style='iospe'">
<xsl:element name="span">
<xsl:attribute name="class" select="'textpartnumber'"/>
<xsl:attribute name="style" select="'left: -4em;'"/>
<xsl:text>Col. </xsl:text>
<xsl:value-of select="@n"/>
<xsl:element name="br"/>
</xsl:element>
</xsl:if>
<xsl:if test="$parm-leiden-style='medcyprus'">
<xsl:if test="preceding-sibling::t:*"><br/><br/></xsl:if>
<xsl:text>Column </xsl:text>
<xsl:value-of select="@n"/>
<xsl:if test="not(preceding-sibling::t:*) or following-sibling::node()[1]!=t:lb"><br/></xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>