Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / odds2 / odd2html.xsl @ 187

History | View | Annotate | Download (8 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet xmlns:s="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dbk="http://docbook.org/ns/docbook" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" exclude-result-prefixes="xlink dbk rng tei teix s xhtml sch a html xs xsl">
3
  <xsl:import href="teiodds.xsl"/>
4
  <xsl:import href="../xhtml2/tei.xsl"/>
5
  <xsl:import href="../xhtml2/oddprocessing.xsl"/>
6

    
7
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
8
    <desc>
9
      <p> TEI stylesheet for making HTML from ODD </p>
10
      <p>This software is dual-licensed:
11

    
12
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
13
Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
14

    
15
2. http://www.opensource.org/licenses/BSD-2-Clause
16
		
17
All rights reserved.
18

    
19
Redistribution and use in source and binary forms, with or without
20
modification, are permitted provided that the following conditions are
21
met:
22

    
23
* Redistributions of source code must retain the above copyright
24
notice, this list of conditions and the following disclaimer.
25

    
26
* Redistributions in binary form must reproduce the above copyright
27
notice, this list of conditions and the following disclaimer in the
28
documentation and/or other materials provided with the distribution.
29

    
30
This software is provided by the copyright holders and contributors
31
"as is" and any express or implied warranties, including, but not
32
limited to, the implied warranties of merchantability and fitness for
33
a particular purpose are disclaimed. In no event shall the copyright
34
holder or contributors be liable for any direct, indirect, incidental,
35
special, exemplary, or consequential damages (including, but not
36
limited to, procurement of substitute goods or services; loss of use,
37
data, or profits; or business interruption) however caused and on any
38
theory of liability, whether in contract, strict liability, or tort
39
(including negligence or otherwise) arising in any way out of the use
40
of this software, even if advised of the possibility of such damage.
41
</p>
42
      <p>Author: See AUTHORS</p>
43
      <p>Id: $Id: odd2html.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
44
      <p>Copyright: 2011, TEI Consortium</p>
45
    </desc>
46
  </doc>
47
  <xsl:output method="xml" encoding="utf-8"/>
48
  <xsl:param name="BITS">Bits</xsl:param>
49
  <xsl:param name="STDOUT">true</xsl:param>
50
  <xsl:param name="TAG"/>
51
  <xsl:param name="alignNavigationPanel">left</xsl:param>
52
  <xsl:param name="authorWord"/>
53
  <xsl:param name="autoToc">true</xsl:param>
54
  <xsl:param name="bottomNavigationPanel">true</xsl:param>
55
  <xsl:param
56
      name="cssFile">http://www.tei-c.org/release/xml/tei/stylesheet/tei.css</xsl:param>
57
  <xsl:param name="dateWord"/>
58
  <xsl:param name="displayMode">rnc</xsl:param>
59
  <xsl:param name="feedbackWords">Contact</xsl:param>
60
  <xsl:param name="footnoteBackLink">true</xsl:param>
61
  <xsl:param name="footnoteFile">false</xsl:param>
62
  <xsl:param name="homeURL">index.html</xsl:param>
63
  <xsl:param name="indent-width" select="3"/>
64
  <xsl:param name="line-width" select="80"/>
65
  <xsl:param name="numberBackHeadings">A.1</xsl:param>
66
  <xsl:param name="numberFrontHeadings"/>
67
  <xsl:param name="pageLayout">Simple</xsl:param>
68
  <xsl:param name="prenumberedHeadings">false</xsl:param>
69
  <xsl:param name="searchURL"/>
70
  <xsl:param name="searchWords"/>
71
  <xsl:param name="showNamespaceDecls">false</xsl:param>
72
  <xsl:param name="showTitleAuthor">1</xsl:param>
73
  <xsl:param name="splitBackmatter">yes</xsl:param>
74
  <xsl:param name="splitFrontmatter">yes</xsl:param>
75
  <xsl:param name="splitLevel">-1</xsl:param>
76
  <xsl:param name="subTocDepth">-1</xsl:param>
77
  <xsl:param name="tocDepth">3</xsl:param>
78
  <xsl:param name="tocElement">div</xsl:param>
79
  <xsl:param name="topNavigationPanel"/>
80
  <xsl:param name="useHeaderFrontMatter">true</xsl:param>
81
  <xsl:param name="verbose">false</xsl:param>
82
  <xsl:param name="doctypePublic">-//W3C//DTD XHTML 1.1//EN</xsl:param>
83
  <xsl:param name="doctypeSystem">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</xsl:param>
84

    
85
  <!-- these are ones to override -->
86
  <xsl:param name="feedbackURL">#</xsl:param>
87
  <xsl:param name="homeLabel">Home</xsl:param>
88
  <xsl:param name="homeWords">Home</xsl:param>
89
  <xsl:param name="institution"/>
90
  <xsl:param name="outputDir"/>
91
  <xsl:param name="parentURL">http://www.example.com/</xsl:param>
92
  <xsl:param name="parentWords"/>
93

    
94
  <xsl:template name="copyrightStatement"/>
95

    
96
  <xsl:template match="processing-instruction()"/>
97

    
98
  <xsl:template name="headingNumberSuffix">
99
    <xsl:text> </xsl:text>
100
  </xsl:template>
101

    
102
  <xsl:template match="tei:divGen[@type='toc']">
103
    <xsl:call-template name="mainTOC"/>
104
  </xsl:template>
105

    
106
  <xsl:template name="oddTocEntry">
107
    <xsl:variable name="loc">
108
      <xsl:choose>
109
        <xsl:when test="number($splitLevel)=-1 or $STDOUT='true'">
110
          <xsl:text>#</xsl:text>
111
          <xsl:value-of select="@ident"/>
112
        </xsl:when>
113
        <xsl:otherwise>
114
          <xsl:text>ref-</xsl:text>
115
          <xsl:value-of select="@ident"/>
116
          <xsl:value-of select="$outputSuffix"/>
117
        </xsl:otherwise>
118
      </xsl:choose>
119
    </xsl:variable>
120
    <div class="oddTocEntry">
121
      <a href="{$loc}">
122
        <xsl:value-of select="@ident"/>
123
      </a>
124
    </div>
125
  </xsl:template>
126

    
127
  <xsl:template match="tei:divGen[@type='index']"/>
128

    
129
  <xsl:template name="logoPicture">
130
    <img src="jaco001d.gif" alt="" width="180"/>
131
  </xsl:template>
132

    
133
  <xsl:template name="hdr2">
134
    <xsl:comment>no nav </xsl:comment>
135
  </xsl:template>
136

    
137
  <xsl:template match="tei:hi[@rend='math']">
138
    <span class="math">
139
      <xsl:apply-templates/>
140
    </span>
141
  </xsl:template>
142

    
143
  <xsl:template name="makeHTMLHeading">
144
    <xsl:param name="text"/>
145
    <xsl:param name="class">title</xsl:param>
146
    <xsl:param name="level">1</xsl:param>
147
    <xsl:if test="not($text='')">
148
      <xsl:choose>
149
        <xsl:when test="$level='1'">
150
          <xsl:element name="h1">
151
            <xsl:attribute name="class">
152
              <xsl:value-of select="$class"/>
153
            </xsl:attribute>
154
            <a href="index.html">
155
              <xsl:value-of select="$text"/>
156
            </a>
157
          </xsl:element>
158
        </xsl:when>
159

    
160
        <xsl:otherwise>
161
          <xsl:element name="h{$level}">
162
            <xsl:attribute name="class">
163
              <xsl:value-of select="$class"/>
164
            </xsl:attribute>
165
            <xsl:value-of select="$text"/>
166
          </xsl:element>
167
        </xsl:otherwise>
168
      </xsl:choose>
169
    </xsl:if>
170
  </xsl:template>
171

    
172
  <xsl:template name="formatHeadingNumber">
173
    <xsl:param name="text"/>
174
    <xsl:param name="toc"/>
175
    <span class="headingNumber">
176
      <xsl:choose>
177
        <xsl:when test="$toc =''">
178
          <xsl:copy-of select="$text"/>
179
        </xsl:when>
180
        <xsl:when test="number(normalize-space($text))&lt;10">
181
          <xsl:text> </xsl:text>
182
          <xsl:copy-of select="$text"/>
183
        </xsl:when>
184
        <xsl:otherwise>
185
          <xsl:copy-of select="$text"/>
186
        </xsl:otherwise>
187
      </xsl:choose>
188
    </span>
189
  </xsl:template>
190

    
191
  <xsl:template name="navInterSep"> </xsl:template>
192

    
193
  <xsl:template name="generateSubTitle">
194
    <xsl:value-of select="tei:head"/>
195
  </xsl:template>
196

    
197
  <xsl:template name="printLink"/>
198

    
199
  <xsl:template match="tei:titlePage" mode="paging">
200
    <xsl:apply-templates select="."/>
201
  </xsl:template>
202

    
203
  <xsl:template name="generateEndLink">
204
      <xsl:param name="where"/>
205
      <xsl:choose>
206
	<xsl:when test="id($where)">
207
	  <xsl:apply-templates mode="generateLink" select="id($where)"/>
208
	</xsl:when>
209
	<xsl:otherwise>
210
	  <xsl:text>[ID </xsl:text>
211
	  <xsl:value-of select="$where"/>
212
	  <xsl:text> in TEI Guidelines]</xsl:text>
213
	</xsl:otherwise>
214
      </xsl:choose>
215
  </xsl:template>
216

    
217
</xsl:stylesheet>