Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: htm-teiapp.xsl 2090 2013-10-24 15:23:22Z gabrielbodard $ -->
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
                xmlns:tei="http://www.tei-c.org/ns/1.0"
5
                xmlns:t="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="t" 
6
                version="2.0">
7
  <!-- Contains app and its children rdg, ptr, note and lem -->
8

    
9
  <xsl:template match="t:app">
10
      <xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
11
      <xsl:choose>
12
         <xsl:when test="@resp='previous'">
13
            <span class="previouslyread">
14
               <xsl:apply-templates/>
15
            </span>
16
         </xsl:when>
17
         <xsl:when test="@resp='autopsy'"/>
18
         <xsl:otherwise>
19
            <xsl:apply-templates/>
20
         </xsl:otherwise>
21
      </xsl:choose>
22

    
23
      <!-- Found in htm-tpl-apparatus - creates links to footnote in apparatus -->
24
      <xsl:if test="$parm-apparatus-style = 'ddbdp'">
25
         <xsl:call-template name="app-link">
26
            <xsl:with-param name="location" select="'text'"/>
27
         </xsl:call-template>
28
      </xsl:if>
29
  </xsl:template>
30

    
31

    
32
  <xsl:template match="t:rdg">
33
      <xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
34
      <xsl:choose>
35
          <xsl:when test="$parm-edition-type = 'diplomatic'">
36
            <xsl:choose>
37
               <xsl:when test="@resp='previous'"/> 
38
               <xsl:when test="@resp='autopsy'">
39
                  <xsl:apply-templates/>
40
               </xsl:when>
41
               <xsl:otherwise/>
42
            </xsl:choose>
43
         </xsl:when>
44
         <xsl:when test="@resp='previous'">
45
            <xsl:apply-templates/>
46
         </xsl:when>
47
         <xsl:when test="@resp='autopsy'"/>
48
         <xsl:when test="parent::t:app"/>
49
         <xsl:otherwise>
50
            <xsl:apply-templates/>
51
         </xsl:otherwise>
52
      </xsl:choose>
53
  </xsl:template>
54

    
55

    
56
  <xsl:template match="t:wit">
57
      <xsl:choose>
58
      <!-- Temporary -->
59
         <xsl:when test="parent::t:app"/>
60
         <xsl:otherwise>
61
            <xsl:apply-templates/>
62
         </xsl:otherwise>
63
      </xsl:choose>
64
  </xsl:template>
65

    
66
  <xsl:template match="t:lem">
67
      <xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
68
      <xsl:param name="parm-hgv-gloss" tunnel="yes" required="no"></xsl:param>
69
      <xsl:choose>
70
          <xsl:when test="$parm-leiden-style=('ddbdp','sammelbuch') and ancestor::t:div[@type='translation']">
71
            <xsl:variable name="wit-val" select="@resp"/>
72
            <xsl:variable name="lang" select="ancestor::t:div[@type = 'translation']/@xml:lang"/>
73
            <span class="term">
74
              <xsl:apply-templates/>
75
              <span class="gloss" style="display:none">
76
              <b><xsl:choose>
77
                  <xsl:when test="$lang = 'en'">
78
                    <xsl:if test=".//t:term[@target]">
79
                      <xsl:text>Glossary/</xsl:text>
80
                    </xsl:if>
81
                    <xsl:text>Correction:</xsl:text>
82
                  </xsl:when>
83
                  <xsl:when test="$lang = 'de'">
84
                    <xsl:if test=".//t:term[@target]">
85
                      <xsl:text>Glossar/</xsl:text>
86
                    </xsl:if>
87
                    <xsl:text>Korrektur:</xsl:text>
88
                  </xsl:when>
89
                </xsl:choose></b>
90
                <xsl:for-each select=".//t:term[@target]">
91
                    <xsl:value-of select="document($parm-hgv-gloss)//t:item[@xml:id = current()/@target]/t:term"/>
92
                  <xsl:text>. </xsl:text>
93
                    <xsl:value-of select="document($parm-hgv-gloss)//t:item[@xml:id = current()/@target]/t:gloss[@xml:lang = $lang]"/>
94
                  <xsl:text>; </xsl:text>
95
                </xsl:for-each>
96
                <xsl:value-of select="$wit-val"/>
97
              </span>                 
98
            </span>
99
         </xsl:when>
100
          <xsl:when test="$parm-leiden-style=('ddbdp','sammelbuch') and ancestor::t:*[local-name()=('reg','corr','rdg') 
101
            or self::t:del[@rend='corrected']]">
102
            <xsl:apply-templates/>
103
            <xsl:if test="@resp">
104
               <xsl:choose>
105
                   <xsl:when test="$parm-leiden-style='ddbdp'"><xsl:text> FNORD-SPLIT </xsl:text></xsl:when>
106
                  <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
107
               </xsl:choose>              
108
               <xsl:if test="parent::t:app[@type='BL']">
109
                  <xsl:text>BL </xsl:text>
110
               </xsl:if>
111
               
112
               <xsl:value-of select="@resp"/>
113
               
114
               <xsl:if test="parent::t:app[@type='SoSOL']">
115
                  <xsl:text> (via PE)</xsl:text>
116
               </xsl:if>
117
               <xsl:choose>
118
                   <xsl:when test="$parm-leiden-style='ddbdp'"><xsl:text> FNORD-DELIM </xsl:text></xsl:when>
119
                  <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
120
               </xsl:choose>  
121
            </xsl:if>
122
            <xsl:choose>
123
               <xsl:when test="parent::t:app[@type='editorial']">
124
                  <xsl:text> (</xsl:text><xsl:for-each select="following-sibling::t:rdg">
125
                     <!-- found in tpl-apparatus.xsl -->
126
                     <xsl:call-template name="app-ed-mult"/>
127
                  </xsl:for-each><xsl:text>)</xsl:text>
128
               </xsl:when>
129
               <xsl:when test="parent::t:app[@type='alternative']">
130
                  <xsl:text> (or </xsl:text>
131
                  <xsl:for-each select="following-sibling::t:rdg">
132
                     <xsl:apply-templates/>
133
                     <xsl:if test="position()!=last()">
134
                        <xsl:text> or </xsl:text>
135
                     </xsl:if>
136
                  </xsl:for-each>
137
                  <xsl:text>)</xsl:text>
138
               </xsl:when>
139
            </xsl:choose>
140
         </xsl:when>
141
         <xsl:when test="parent::t:app[@type='previouslyread']">
142
            <span class="previouslyread">
143
               <xsl:apply-templates/>
144
            </span>
145
         </xsl:when>
146
          <xsl:when test="$parm-leiden-style='iospe' and ../t:rdg">
147
            <xsl:apply-templates/>
148
            <xsl:text> resp. </xsl:text>
149
            <xsl:for-each select="../t:rdg">
150
               <xsl:apply-templates/>
151
               <xsl:if test="not(position()=last())">
152
                  <xsl:text>, </xsl:text>
153
               </xsl:if>
154
            </xsl:for-each>
155
         </xsl:when>
156
         <xsl:otherwise>
157
            <xsl:apply-templates/>
158
         </xsl:otherwise>
159
      </xsl:choose>
160
  </xsl:template>
161

    
162
</xsl:stylesheet>
(9-9/95)