Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: teiaddanddel.xsl 2090 2013-10-24 15:23:22Z gabrielbodard $ -->
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
   xmlns:t="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="t"  version="2.0">
5
   <!-- Contains templates for subst, add and del -->
6
   
7
   <!-- Imported by htm-teiaddanddel.xsl or called directly from start-txt.xsl -->
8
   
9
   <xsl:template match="t:subst">
10
       <xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
11
       <xsl:apply-templates/>
12

    
13
       <xsl:if test="$parm-apparatus-style = 'ddbdp'">
14
         <!-- Found in [htm|txt]-tpl-apparatus -->
15
         <xsl:call-template name="app-link">
16
            <xsl:with-param name="location" select="'text'"/>
17
         </xsl:call-template>
18
      </xsl:if>
19
   </xsl:template>
20

    
21

    
22
   <xsl:template match="t:add">
23
       <xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
24
       <xsl:choose>
25
           <xsl:when test="$parm-leiden-style=('ddbdp','sammelbuch')">
26
            <xsl:choose>
27
               <xsl:when test="parent::t:subst"/>
28
               <xsl:when test="@place = 'above'">
29
                  <xsl:text>\</xsl:text>
30
               </xsl:when>
31
               <xsl:when test="@place = 'below'">
32
                  <xsl:text>/</xsl:text>
33
               </xsl:when>
34
               <xsl:when test="@place = 'left'">
35
                  <xsl:text>(added at left: </xsl:text>
36
               </xsl:when>
37
               <xsl:when test="@place = 'right'">
38
                  <xsl:text>(added at right: </xsl:text>
39
               </xsl:when>
40
            </xsl:choose>
41
         </xsl:when>
42
           <xsl:when test="$parm-leiden-style=('petrae','iospe')">
43
            <xsl:text>\</xsl:text>
44
         </xsl:when>
45
         <xsl:otherwise>
46
            <xsl:choose>
47
               <xsl:when test="parent::t:subst or @place='overstrike'">
48
                  <xsl:text>«</xsl:text>
49
               </xsl:when>
50
               <xsl:otherwise>
51
                  <xsl:text>`</xsl:text>
52
               </xsl:otherwise>
53
            </xsl:choose>
54
         </xsl:otherwise>
55
      </xsl:choose>
56
      <xsl:apply-templates/>
57
      <xsl:call-template name="cert-low"/>
58

    
59
      <xsl:choose>
60
          <xsl:when test="$parm-leiden-style=('ddbdp','sammelbuch')">
61
            <xsl:choose>
62
               <!-- if my parent is subst which in turn is in the appcrit-part of a further app-like element 
63
                  (i.e. my ancestor is reg, corr, rdg, or del[corrected]), then include value of my sibling del in parens -->
64
               <xsl:when test="parent::t:subst and ancestor::t:*[local-name()=('reg','corr','rdg') 
65
                  or self::t:del[@rend='corrected']]">
66
                  <!-- If add contains app, *only* render del (because add is rendered before the subst by app templates) -->
67
                  <xsl:text> (</xsl:text><xsl:choose>
68
                     <xsl:when test="t:app"><xsl:call-template name="resolvesubst">
69
                           <!-- From tpl-apparatus.xsl -->
70
                           <xsl:with-param name="delpath" select="../t:del/node()"/>
71
                        </xsl:call-template></xsl:when>
72
                     <xsl:otherwise><xsl:call-template name="resolvesubst">
73
                           <!-- From tpl-apparatus.xsl -->
74
                           <xsl:with-param name="delpath" select="../t:del/node()"/>
75
                           <xsl:with-param name="addpath" select="node()"/>
76
                        </xsl:call-template></xsl:otherwise></xsl:choose><xsl:text>)</xsl:text>
77
               </xsl:when>
78
               <xsl:when test="parent::t:subst"/>
79
               <xsl:when test="@place = 'above'">
80
                  <xsl:text>/</xsl:text>
81
               </xsl:when>
82
               <xsl:when test="@place = 'below'">
83
                  <xsl:text>\</xsl:text>
84
               </xsl:when>
85
               <xsl:when test="@place = 'left' or @place = 'right'">
86
                  <xsl:text>)</xsl:text>
87
               </xsl:when>
88
            </xsl:choose>
89
         </xsl:when>
90
          <xsl:when test="$parm-leiden-style=('petrae','iospe')">
91
            <xsl:text>/</xsl:text>
92
         </xsl:when>
93
         <xsl:otherwise>
94
            <xsl:choose>
95
               <xsl:when test="parent::t:subst or @place='overstrike'">
96
                  <xsl:text>»</xsl:text>
97
               </xsl:when>
98
               <xsl:otherwise>
99
                  <xsl:text>´</xsl:text>
100
               </xsl:otherwise>
101
            </xsl:choose>
102
         </xsl:otherwise>
103
      </xsl:choose>
104
   </xsl:template>
105

    
106

    
107
   <xsl:template match="t:del">
108
       <xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
109
       <xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
110
       <xsl:if test="$parm-apparatus-style = 'ddbdp'">
111
         <xsl:if test="@rend = 'slashes' or @rend = 'cross-strokes'">
112
            <!-- Found in [htm | txt]-tpl-apparatus -->
113
            <xsl:call-template name="app-link">
114
               <xsl:with-param name="location" select="'text'"/>
115
            </xsl:call-template>
116
         </xsl:if>
117
      </xsl:if>
118

    
119
      <xsl:choose>
120
          <xsl:when test="starts-with($parm-leiden-style, 'edh') or $parm-leiden-style=('petrae','iospe')">
121
            <xsl:text>[[</xsl:text>
122
            <xsl:apply-templates/>
123
            <xsl:text>]]</xsl:text>
124
         </xsl:when>
125
          <xsl:when test="($parm-leiden-style = 'ddbdp' or $parm-leiden-style = 'sammelbuch') and @rend='slashes'">
126
            <xsl:apply-templates/>
127
         </xsl:when>
128
          <xsl:when test="($parm-leiden-style = 'ddbdp' or $parm-leiden-style = 'sammelbuch') and @rend='cross-strokes'">
129
            <xsl:apply-templates/>
130
         </xsl:when>
131
          <xsl:when test="$parm-leiden-style = 'rib'">
132
              <xsl:choose>
133
                  <xsl:when test="@rend='erasure'">
134
                      <span class="erasure"><xsl:apply-templates/></span>
135
                  </xsl:when>
136
                  <xsl:when test="not(@rend)"/>
137
                  <xsl:otherwise>
138
                      <xsl:apply-templates/>
139
                  </xsl:otherwise>
140
              </xsl:choose>
141
          </xsl:when>
142
          <xsl:when test="parent::t:subst"/>
143
         <xsl:otherwise>
144
            <xsl:text>&#x27e6;</xsl:text>
145
            <xsl:apply-templates/>
146
            <xsl:call-template name="cert-low"/>
147
            <xsl:text>&#x27e7;</xsl:text>
148
         </xsl:otherwise>
149
      </xsl:choose>
150
   </xsl:template>
151

    
152
</xsl:stylesheet>
(49-49/95)