-
Notifications
You must be signed in to change notification settings - Fork 0
/
teisupplied.xsl
133 lines (122 loc) · 5.78 KB
/
teisupplied.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?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"
xmlns:EDF="http://epidoc.sourceforge.net/ns/functions"
exclude-result-prefixes="t EDF"
version="2.0">
<xsl:template match="t:supplied[@evidence='parallel']" priority="1">
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:choose>
<xsl:when test="$parm-leiden-style = 'dclp'"><xsl:call-template name="supplied-parallel"/></xsl:when>
<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="t:supplied[@reason='lost']">
<xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="location" />
<xsl:if test="($parm-leiden-style = ('ddbdp','dclp','sammelbuch')) and child::t:*[1][local-name() = 'milestone'][@rend = 'paragraphos']">
<br/>
</xsl:if>
<xsl:choose>
<xsl:when test="@evidence = 'parallel'">
<!-- Found in [htm|txt]-teisupplied.xsl -->
<xsl:call-template name="supplied-parallel"/>
</xsl:when>
<xsl:otherwise>
<!-- *NB* the lost-opener and lost-closer templates, found in tpl-reasonlost.xsl,
are no longer used in this version of the stylesheets. They used to serve to limit
the superfluous square brackets between adjacent gap and supplied elements,
but this function is now performed by regex in [htm|txt]-tpl-sqbrackets.xsl
which is called after all other templates are completed.
-->
<xsl:text>[</xsl:text>
<xsl:choose>
<xsl:when test="$parm-edition-type = 'diplomatic'">
<xsl:variable name="supplied-content">
<xsl:value-of select="descendant::text()"/>
</xsl:variable>
<xsl:variable name="sup-context-length">
<xsl:value-of select="string-length(normalize-space($supplied-content))"/>
</xsl:variable>
<xsl:variable name="space-ex">
<xsl:choose>
<xsl:when test="number(descendant::t:space/@extent)">
<xsl:number value="descendant::t:space/@extent"/>
</xsl:when>
<xsl:otherwise>
<xsl:number value="1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="t:g">
<xsl:text>··</xsl:text>
</xsl:for-each>
<!-- Found in teigap.xsl -->
<xsl:call-template name="dot-out">
<xsl:with-param name="cur-num" select="$sup-context-length"/>
</xsl:call-template>
<xsl:call-template name="dot-out">
<xsl:with-param name="cur-num" select="$space-ex"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
<!-- Found in tpl-cert-low.xsl -->
<xsl:call-template name="cert-low"/>
<!-- function EDF:f-wwrap declared in htm-teilb.xsl; tests if lb break=no immediately follows supplied -->
<xsl:if test="EDF:f-wwrap(.) = true()">
<!-- unless this is in the app part of a choice/subst/app in ddbdp -->
<xsl:if test="(not($parm-leiden-style=('ddbdp','dclp') and (ancestor::t:*[local-name()=('reg','corr','rdg') or self::t:del[parent::t:subst]]))) and (not($location = 'apparatus'))">
<xsl:text>-</xsl:text>
</xsl:if>
</xsl:if>
<!-- *NB* the lost-opener and lost-closer templates, found in tpl-reasonlost.xsl,
are no longer used in this version of the stylesheets. They used to serve to limit
the superfluous square brackets between adjacent gap and supplied elements,
but this function is now performed by regex in [htm|txt]-tpl-sqbrackets.xsl
which is called after all other templates are completed.
-->
<xsl:text>]</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="t:supplied[@reason='omitted']">
<xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
<xsl:choose>
<xsl:when test="$parm-edition-type='diplomatic'"/>
<xsl:when test="@evidence = 'parallel'">
<!-- Found in [htm|txt]-teisupplied.xsl -->
<xsl:call-template name="supplied-parallel"/>
</xsl:when>
<xsl:otherwise>
<xsl:text><</xsl:text>
<xsl:apply-templates/>
<!-- Found in tpl-cert-low.xsl -->
<xsl:call-template name="cert-low"/>
<xsl:text>></xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="t:supplied[@reason='subaudible']">
<xsl:text>(</xsl:text>
<xsl:apply-templates/>
<xsl:call-template name="cert-low"/>
<xsl:text>)</xsl:text>
</xsl:template>
<xsl:template match="t:supplied[@reason='explanation']">
<xsl:text>(i.e. </xsl:text>
<xsl:apply-templates/>
<xsl:call-template name="cert-low"/>
<xsl:text>)</xsl:text>
</xsl:template>
<xsl:template match="t:supplied[@evidence='apograph']">
<xsl:text>⌈</xsl:text>
<xsl:apply-templates/>
<xsl:call-template name="cert-low"/>
<xsl:text>⌉</xsl:text>
</xsl:template>
</xsl:stylesheet>