Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: teiref.xsl 1725 2012-01-10 16:08:31Z 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" 
5
                version="2.0">
6
  <!-- Called from [htm|txt]-teiref.xsl -->
7
  
8
  <xsl:template name="reprint-text">
9
      <xsl:param name="direction"/>
10
    
11
      <xsl:text>[</xsl:text>
12
      <xsl:text>Reprinted </xsl:text>
13
      <xsl:value-of select="$direction"/>
14
      <xsl:text>: </xsl:text>
15
      <xsl:call-template name="divide-links">
16
         <xsl:with-param name="val" select="@n"/>
17
      </xsl:call-template>
18
      <xsl:text>] </xsl:text>
19
      <xsl:apply-templates/>
20
  </xsl:template>
21
  
22
  
23
  
24
  <!-- Templates used for reprint in ddbdp -->
25
  <xsl:template name="divide-links">
26
      <xsl:param name="val"/>
27
    
28
      <xsl:variable name="cur-string">
29
         <xsl:choose>
30
            <xsl:when test="contains($val, '|')">
31
               <xsl:value-of select="substring-before(normalize-space($val), '|')"/>
32
            </xsl:when>
33
            <xsl:otherwise>
34
               <xsl:value-of select="$val"/>
35
            </xsl:otherwise>
36
         </xsl:choose>
37
      </xsl:variable>
38
      <xsl:variable name="pass-string" select="substring-after(normalize-space($val), '|')"/>
39
    
40
      <xsl:call-template name="build-path">
41
         <xsl:with-param name="val" select="$cur-string"/>
42
         <xsl:with-param name="fol-val">
43
            <xsl:if test="string($pass-string)">
44
               <xsl:text>yes</xsl:text>
45
            </xsl:if>
46
         </xsl:with-param>
47
      </xsl:call-template>
48
    
49
      <xsl:if test="string($pass-string)">
50
         <xsl:call-template name="divide-links">
51
            <xsl:with-param name="val" select="$pass-string"/>
52
         </xsl:call-template>
53
      </xsl:if>
54
  </xsl:template>  
55
  
56
  
57
  
58
  <xsl:template name="build-path">
59
      <xsl:param name="val"/>
60
      <xsl:param name="fol-val"/>
61
    
62
      <xsl:variable name="cur-file-vol-doc"
63
                    select="substring-after(normalize-space(/t:TEI/@n), ';')"/>
64
      <xsl:variable name="cur-file-vol" select="substring-before($cur-file-vol-doc, ';')"/>
65
    
66
      <xsl:variable name="val-col" select="substring-before($val, ';')"/>
67
      <xsl:variable name="val-vol-doc" select="substring-after($val, ';')"/>
68
      <xsl:variable name="val-vol" select="substring-before($val-vol-doc, ';')"/>
69
      <xsl:variable name="val-doc">
70
         <xsl:value-of select="$val-col"/>
71
         <xsl:text>.</xsl:text>
72
         <xsl:if test="string(normalize-space($val-vol))">
73
            <xsl:value-of select="$val-vol"/>
74
            <xsl:text>.</xsl:text>
75
         </xsl:if>
76
         <xsl:value-of select="substring-after($val-vol-doc, ';')"/>
77
      </xsl:variable>
78
    
79
      <xsl:variable name="href-link">
80
         <xsl:if test="string(normalize-space($cur-file-vol))">
81
            <xsl:text>../</xsl:text>
82
         </xsl:if>
83
         <xsl:text>../</xsl:text>
84
         <xsl:value-of select="$val-col"/>
85
         <xsl:text>/</xsl:text>
86
         <xsl:if test="string(normalize-space($val-vol))">
87
            <xsl:value-of select="$val-col"/>
88
            <xsl:text>.</xsl:text>
89
            <xsl:value-of select="$val-vol"/>
90
            <xsl:text>/</xsl:text>
91
         </xsl:if>
92
         <xsl:value-of select="$val-doc"/>
93
         <xsl:text>.html</xsl:text>
94
      </xsl:variable>
95
    
96
      <!-- Found in [htm|txt]-teiref.xsl -->
97
    <xsl:call-template name="link-text">
98
         <xsl:with-param name="href-link" select="$href-link"/>
99
         <xsl:with-param name="val-doc" select="$val-doc"/>
100
      </xsl:call-template>
101
    
102
      <xsl:if test="$fol-val = 'yes'">
103
         <xsl:text> | </xsl:text>
104
      </xsl:if>
105
  </xsl:template>
106
</xsl:stylesheet>
(65-65/95)