1
|
<?xml version="1.0"?>
|
2
|
<!--
|
3
|
* '$RCSfile$'
|
4
|
* Authors: Matthew Brooke
|
5
|
* Copyright: 2000 Regents of the University of California and the
|
6
|
* National Center for Ecological Analysis and Synthesis
|
7
|
* For Details: http://www.nceas.ucsb.edu/
|
8
|
*
|
9
|
* '$Author: mecum $'
|
10
|
* '$Date: 2017-10-06 16:06:42 -0700 (Fri, 06 Oct 2017) $'
|
11
|
* '$Revision: 10422 $'
|
12
|
*
|
13
|
* This program is free software; you can redistribute it and/or modify
|
14
|
* it under the terms of the GNU General Public License as published by
|
15
|
* the Free Software Foundation; either version 2 of the License, or
|
16
|
* (at your option) any later version.
|
17
|
*
|
18
|
* This program is distributed in the hope that it will be useful,
|
19
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21
|
* GNU General Public License for more details.
|
22
|
*
|
23
|
* You should have received a copy of the GNU General Public License
|
24
|
* along with this program; if not, write to the Free Software
|
25
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
26
|
*
|
27
|
* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
|
28
|
* convert an XML file that is valid with respect to the eml-variable.dtd
|
29
|
* module of the Ecological Metadata Language (EML) into an HTML format
|
30
|
* suitable for rendering with modern web browsers.
|
31
|
-->
|
32
|
<xsl:stylesheet
|
33
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
34
|
<xsl:output method="html"
|
35
|
encoding="UTF-8"
|
36
|
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
37
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
38
|
indent="yes" />
|
39
|
|
40
|
<xsl:template name="text">
|
41
|
<xsl:apply-templates />
|
42
|
</xsl:template>
|
43
|
|
44
|
<xsl:template match="section">
|
45
|
<div class="sectionText">
|
46
|
<xsl:apply-templates />
|
47
|
</div>
|
48
|
</xsl:template>
|
49
|
|
50
|
<xsl:template match="para">
|
51
|
<p>
|
52
|
<xsl:apply-templates />
|
53
|
</p>
|
54
|
</xsl:template>
|
55
|
|
56
|
<!-- This template dynamically decides on h4-h6 depending on how deeply nested its parent section element is in the
|
57
|
document. -->
|
58
|
<xsl:template match="title">
|
59
|
<xsl:choose>
|
60
|
<xsl:when test="count(ancestor::section) > 2">
|
61
|
<h6>
|
62
|
<xsl:apply-templates />
|
63
|
</h6>
|
64
|
</xsl:when>
|
65
|
<xsl:when test="count(ancestor::section) > 1">
|
66
|
<h5>
|
67
|
<xsl:apply-templates />
|
68
|
</h5>
|
69
|
</xsl:when>
|
70
|
<xsl:otherwise>
|
71
|
<h4>
|
72
|
<xsl:apply-templates />
|
73
|
</h4>
|
74
|
</xsl:otherwise>
|
75
|
</xsl:choose>
|
76
|
</xsl:template>
|
77
|
|
78
|
<xsl:template match="orderedlist">
|
79
|
<ol>
|
80
|
<xsl:apply-templates />
|
81
|
</ol>
|
82
|
</xsl:template>
|
83
|
|
84
|
<xsl:template match="itemizedlist">
|
85
|
<ul>
|
86
|
<xsl:apply-templates />
|
87
|
</ul>
|
88
|
</xsl:template>
|
89
|
|
90
|
<xsl:template match="listitem">
|
91
|
<li>
|
92
|
<xsl:apply-templates />
|
93
|
</li>
|
94
|
</xsl:template>
|
95
|
|
96
|
<xsl:template match="emphasis">
|
97
|
<emphasis>
|
98
|
<xsl:apply-templates />
|
99
|
</emphasis>
|
100
|
</xsl:template>
|
101
|
|
102
|
<xsl:template match="literalLayout">
|
103
|
<pre>
|
104
|
<xsl:apply-templates />
|
105
|
</pre>
|
106
|
</xsl:template>
|
107
|
|
108
|
<!-- Note: This template doesn't fully support ulink in that a single ulink can have multiple citetitle's and
|
109
|
translations and this template only uses the first citetitle and disregards internationalization details.-->
|
110
|
<xsl:template match="ulink">
|
111
|
<xsl:element name="a">
|
112
|
<xsl:attribute name="href">
|
113
|
<xsl:value-of select="./@url" />
|
114
|
</xsl:attribute>
|
115
|
<xsl:apply-templates />
|
116
|
</xsl:element>
|
117
|
</xsl:template>
|
118
|
|
119
|
<xsl:template match="superscript">
|
120
|
<sup>
|
121
|
<xsl:apply-templates />
|
122
|
</sup>
|
123
|
</xsl:template>
|
124
|
|
125
|
<xsl:template match="subscript">
|
126
|
<sub>
|
127
|
<xsl:apply-templates />
|
128
|
</sub>
|
129
|
</xsl:template>
|
130
|
|
131
|
<xsl:template match="value">
|
132
|
<xsl:if test="./text() != ''">
|
133
|
<p class="translation">
|
134
|
<xsl:if test="./@xml:lang != ''">
|
135
|
(<xsl:value-of select="./@xml:lang"/>)
|
136
|
</xsl:if>
|
137
|
<xsl:value-of select="./text()"/>
|
138
|
</p>
|
139
|
</xsl:if>
|
140
|
</xsl:template>
|
141
|
</xsl:stylesheet>
|