forked from EpiDoc/Stylesheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
htm-teimilestone.xsl
70 lines (67 loc) · 2.87 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
<?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:choose>
<xsl:when
test="($parm-leiden-style = 'ddbdp' or $parm-leiden-style = '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' or $parm-leiden-style = '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'">
<!-- 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)">
<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: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:template>
</xsl:stylesheet>