Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: htm-teiab.xsl 2097 2013-11-08 11:56:50Z 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
  
7
  <xsl:template match="t:ab">
8
      <xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
9
      <xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
10
      <div class="textpart">
11
          <xsl:if test="$parm-leiden-style='iospe'">
12
            <xsl:variable name="div-loc">
13
               <xsl:for-each select="ancestor::t:div[@type='textpart']">
14
                  <xsl:value-of select="@n"/>
15
                  <xsl:text>-</xsl:text>
16
               </xsl:for-each>
17
            </xsl:variable>
18
            <xsl:attribute name="id">
19
               <xsl:value-of select="concat('div',$div-loc)"/>
20
            </xsl:attribute>
21
         </xsl:if>
22
         <xsl:apply-templates/>
23
         <!-- if next div or ab begins with lb[break=no], then add hyphen -->
24
          <xsl:if test="following::t:lb[1][@break='no' or @type='inWord'] and not($parm-edition-type='diplomatic')">
25
            <xsl:text>-</xsl:text>
26
         </xsl:if>
27
         <!-- if final lb in ab is L2R or R2L, then print arrow here -->
28
         <xsl:if test="not($parm-leiden-style=('ddbdp','sammelbuch')) 
29
            and descendant::t:lb[last()][@rend='left-to-right']">
30
            <xsl:text>&#xa0;&#xa0;</xsl:text>
31
         </xsl:if>
32
         <xsl:if test="not($parm-leiden-style=('ddbdp','sammelbuch')) 
33
            and descendant::t:lb[last()][@rend='right-to-left']">
34
            <xsl:text>&#xa0;&#xa0;</xsl:text>
35
         </xsl:if>
36
         <!-- in IOSPE, if followed by lg, include it here (and suppress in htm-teilgandl.xsl) -->
37
          <xsl:if test="$parm-leiden-style='iospe' and following-sibling::t:*[1][self::t:lg]">
38
            <xsl:apply-templates select="following-sibling::t:lg/*"/>
39
         </xsl:if>
40
      </div>
41
  </xsl:template>
42

    
43
</xsl:stylesheet>
(7-7/95)