Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: txt-tpl-apparatus.xsl 1674 2011-12-05 15:48:48Z rviglianti $ -->
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
                xmlns:t="http://www.tei-c.org/ns/1.0"
5
                version="2.0">
6
  <!-- Apparatus creation: look in tpl-apparatus.xsl for documentation -->
7
  <xsl:include href="tpl-apparatus.xsl"/>
8
  
9
  <!-- Apparatus framework -->
10
  <xsl:template name="tpl-apparatus">
11
    <!-- An apparatus is only created if one of the following is true -->
12
     <xsl:if test=".//t:choice[child::t:sic and child::t:corr] | .//t:choice[child::t:orig and child::t:reg] | .//t:subst | .//t:app |        
13
       .//t:hi[@rend = 'diaeresis' or @rend = 'grave' or @rend = 'acute' or @rend = 'asper' or @rend = 'lenis' or @rend = 'circumflex'] |
14
       .//t:del[@rend='slashes' or @rend='cross-strokes'] | .//t:milestone[@rend = 'box']">
15
      
16
         <xsl:text>
17

    
18
Apparatus
19

    
20
</xsl:text>
21
         <!-- An entry is created for-each of the following instances -->
22
       <xsl:for-each select=".//t:choice[child::t:sic and child::t:corr] | .//t:choice[child::t:orig and child::t:reg] | .//t:subst | .//t:app |
23
         .//t:hi[@rend = 'diaeresis' or @rend = 'grave' or @rend = 'acute' or @rend = 'asper' or @rend = 'lenis' or @rend = 'circumflex'] |
24
         .//t:del[@rend='slashes' or @rend='cross-strokes'] | .//t:milestone[@rend = 'box']">
25
        
26
            <xsl:call-template name="app-link">
27
               <xsl:with-param name="location" select="'apparatus'"/>
28
            </xsl:call-template>
29
        
30
            <!-- Found in tpl-apparatus.xsl -->
31
        <xsl:call-template name="ddbdp-app"/>
32
        
33
            <!-- Only creates a new line if the following is not true -->
34
        <!--<xsl:if test="not(descendant::t:choice | descendant::t:subst | descendant::t:app)">
35
               <xsl:text>
36
&#xD;</xsl:text>
37
            </xsl:if>-->
38
         </xsl:for-each>
39
         <!-- End of apparatus -->
40
      <xsl:text>
41
&#xD;
42
&#xD;</xsl:text>
43
     </xsl:if>
44
     
45
  </xsl:template>
46

    
47

    
48
   <xsl:template name="lbrk-app">
49
      <xsl:text>
50
&#xD;</xsl:text>
51
   </xsl:template>
52

    
53
  <!-- Used in txt-{element} and above to indicate apparatus -->
54
  <xsl:template name="app-link">
55
    <!-- location defines the direction of linking -->
56
    <xsl:param name="location"/>
57
    
58
      <!-- Only produces an indicator if it is not nested in an element that would be in apparatus -->
59
    <xsl:if test="not(ancestor::t:choice or ancestor::t:subst or ancestor::t:app or
60
       ancestor::t:hi[@rend = 'diaeresis' or @rend = 'grave' or @rend = 'acute' or
61
       @rend = 'asper' or @rend = 'lenis' or @rend = 'circumflex'] |
62
       ancestor::t:del[@rend='slashes' or @rend='cross-strokes'])">
63
         <xsl:choose>
64
            <xsl:when test="$location = 'text'">
65
               <xsl:text>(*)</xsl:text>
66
            </xsl:when>
67
            <xsl:when test="$location = 'apparatus'">
68
               <xsl:text>^ </xsl:text>
69
            </xsl:when>
70
         </xsl:choose>
71
      </xsl:if>
72
  </xsl:template>
73
  
74
</xsl:stylesheet>
(93-93/95)