-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtm-teimilestone.xsl
65 lines (62 loc) · 2.96 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
<?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>
<!-- <xsl:message>htm-teimilestone.xsl: match=t:milestone; parm-leiden-style: <xsl:value-of select="$parm-leiden-style"/></xsl:message> -->
<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'))">
<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'">
<!-- <xsl:message><xsl:text> </xsl:text>paragraphos!</xsl:message> -->
<!-- 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)">
<br/>
</xsl:if>
<xsl:text>——</xsl:text>
</xsl:when>
<xsl:when test="@rend = 'diple-obelismene' and @unit='undefined'">
<!-- <xsl:message><xsl:text> </xsl:text>paragraphos!</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:otherwise>
<br/>
<xsl:value-of select="@rend"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>