Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: teisupplied.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" 
5
   xmlns:EDF="http://epidoc.sourceforge.net/ns/functions"
6
                exclude-result-prefixes="t EDF" 
7
                version="2.0">
8

    
9
  <xsl:template match="t:supplied[@reason='lost']">
10
      <xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
11
      <xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
12
      <xsl:param name="location" />
13
      <xsl:if test="($parm-leiden-style = 'ddbdp' or $parm-leiden-style = 'sammelbuch') and child::t:*[1][local-name() = 'milestone'][@rend = 'paragraphos']">
14
         <br/>
15
      </xsl:if>
16
      <xsl:choose>
17
         <xsl:when test="@evidence = 'parallel'">
18
        <!-- Found in [htm|txt]-teisupplied.xsl -->
19
        <xsl:call-template name="supplied-parallel"/>
20
         </xsl:when>
21
         <xsl:otherwise>
22
        <!-- *NB* the lost-opener and lost-closer templates, found in tpl-reasonlost.xsl,
23
           are no longer used in this version of the stylesheets. They used to serve to limit
24
           the superfluous square brackets between adjacent gap and supplied elements,
25
           but this function is now performed by regex in [htm|txt]-tpl-sqbrackets.xsl
26
           which is called after all other templates are completed.
27
        -->
28
            <xsl:text>[</xsl:text>
29
            <xsl:choose>
30
                <xsl:when test="$parm-edition-type = 'diplomatic'">
31
                  <xsl:variable name="supplied-content">
32
                     <xsl:value-of select="descendant::text()"/>
33
                  </xsl:variable>
34
                  <xsl:variable name="sup-context-length">
35
                     <xsl:value-of select="string-length(normalize-space($supplied-content))"/>
36
                  </xsl:variable>
37
                  <xsl:variable name="space-ex">
38
                     <xsl:choose>
39
                        <xsl:when test="number(descendant::t:space/@extent)">
40
                           <xsl:number value="descendant::t:space/@extent"/>
41
                        </xsl:when>
42
                        <xsl:otherwise>
43
                           <xsl:number value="1"/>
44
                        </xsl:otherwise>
45
                     </xsl:choose>
46
                  </xsl:variable>
47
                  <xsl:for-each select="t:g">
48
                     <xsl:text>··</xsl:text>
49
                  </xsl:for-each>
50
                  <!-- Found in teigap.xsl -->
51
            <xsl:call-template name="dot-out">
52
                     <xsl:with-param name="cur-num" select="$sup-context-length"/>
53
                  </xsl:call-template>
54
                  <xsl:call-template name="dot-out">
55
                     <xsl:with-param name="cur-num" select="$space-ex"/>
56
                  </xsl:call-template>
57
               </xsl:when>
58
               <xsl:otherwise>
59
                  <xsl:apply-templates/>
60
               </xsl:otherwise>
61
            </xsl:choose>
62
            <!-- Found in tpl-cert-low.xsl -->
63
            <xsl:call-template name="cert-low"/>
64
            <!-- function EDF:f-wwrap declared in htm-teilb.xsl; tests if lb break=no immediately follows supplied -->
65
            <xsl:if test="EDF:f-wwrap(.) = true()">
66
               <!-- unless this is in the app part of a choice/subst/app in ddbdp -->
67
                <xsl:if test="(not($parm-leiden-style='ddbdp' and (ancestor::t:*[local-name()=('reg','corr','rdg') or self::t:del[parent::t:subst]]))) and (not($location = 'apparatus'))">
68
                  <xsl:text>-</xsl:text>
69
               </xsl:if>
70
            </xsl:if>
71
            <!-- *NB* the lost-opener and lost-closer templates, found in tpl-reasonlost.xsl,
72
           are no longer used in this version of the stylesheets. They used to serve to limit
73
           the superfluous square brackets between adjacent gap and supplied elements,
74
           but this function is now performed by regex in [htm|txt]-tpl-sqbrackets.xsl
75
           which is called after all other templates are completed.
76
        -->
77
            <xsl:text>]</xsl:text>
78
         </xsl:otherwise>
79
      </xsl:choose>
80
  </xsl:template>
81
  
82

    
83
  <xsl:template match="t:supplied[@reason='omitted']">
84
      <xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
85
      <xsl:choose>
86
          <xsl:when test="$parm-edition-type='diplomatic'"/>
87
         <xsl:when test="@evidence = 'parallel'">
88
        <!-- Found in [htm|txt]-teisupplied.xsl -->
89
        <xsl:call-template name="supplied-parallel"/>
90
         </xsl:when>
91
         <xsl:otherwise>
92
            <xsl:text>&lt;</xsl:text>
93
            <xsl:apply-templates/>
94
            <!-- Found in tpl-cert-low.xsl -->
95
        <xsl:call-template name="cert-low"/>
96
            <xsl:text>&gt;</xsl:text>
97
         </xsl:otherwise>
98
      </xsl:choose>
99
  </xsl:template>
100
  
101

    
102
  <xsl:template match="t:supplied[@reason='subaudible']">
103
      <xsl:text>(</xsl:text>
104
     <xsl:apply-templates/>
105
     <xsl:call-template name="cert-low"/>
106
     <xsl:text>)</xsl:text>
107
  </xsl:template>
108
  
109

    
110
  <xsl:template match="t:supplied[@reason='explanation']">
111
      <xsl:text>(i.e. </xsl:text>
112
      <xsl:apply-templates/>
113
      <xsl:call-template name="cert-low"/>
114
      <xsl:text>)</xsl:text>
115
  </xsl:template>
116

    
117

    
118
</xsl:stylesheet>
(69-69/95)