forked from EpiDoc/Stylesheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fo-teidiv.xsl
42 lines (37 loc) · 1.71 KB
/
fo-teidiv.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!-- $Id$ --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://www.tei-c.org/ns/1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="t" version="2.0">
<xsl:template match="t:div">
<!-- div[@type = 'edition']" and div[@type='textpart'] can be found in htm-teidivedition.xsl -->
<div>
<xsl:if test="parent::t:body and @type">
<xsl:attribute name="id">
<xsl:value-of select="@type"/>
</xsl:attribute>
</xsl:if>
<!-- Temporary headings so we know what is where -->
<xsl:if test="not(t:head)">
<xsl:choose>
<xsl:when test="@type='commentary' and @subtype='frontmatter'"><h3>Introduction</h3></xsl:when>
<xsl:when test="@type='commentary' and @subtype='linebyline'"><h3>Notes</h3></xsl:when>
<xsl:when test="@type = 'translation'">
<h2>
<xsl:value-of select="/t:TEI/t:teiHeader/t:profileDesc/t:langUsage/t:language[@ident = current()/@xml:lang]"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@type"/>
</h2>
</xsl:when>
<xsl:otherwise>
<h2>
<xsl:value-of select="@type"/>
<xsl:if test="string(@subtype)">
<xsl:text>: </xsl:text>
<xsl:value-of select="@subtype"/>
</xsl:if>
</h2>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<!-- Body of the div -->
<xsl:apply-templates/>
</div>
</xsl:template>
</xsl:stylesheet>