Project

General

Profile

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: leinfelder $'
10
  *     '$Date: 2013-07-15 14:17:45 -0700 (Mon, 15 Jul 2013) $'
11
  * '$Revision: 7987 $'
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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
33
  <!--<xsl:import href="eml-party.xsl"/>
34
  <xsl:import href="eml-distribution.xsl"/>
35
  <xsl:import href="eml-coverage.xsl"/>-->
36
  <xsl:output method="html" encoding="UTF-8"
37
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
38
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
39
    indent="yes" />  
40

    
41
  <!-- This module is for resouce and it is self-contained (it is table)-->
42
  <xsl:template name="resource">
43
    <xsl:param name="resfirstColStyle"/>
44
    <xsl:param name="ressubHeaderStyle"/>
45
    <xsl:param name="creator">Data Set Creator(s):</xsl:param>
46
  </xsl:template>
47

    
48
  <!-- style the alternate identifier elements -->
49
  <xsl:template name="resourcealternateIdentifier" >
50
      <xsl:param name="resfirstColStyle"/>
51
      <xsl:param name="ressecondColStyle"/>
52
      <xsl:if test="normalize-space(.)!=''">
53
      <tr>
54
        <td class="{$resfirstColStyle}">Alternate Identifier:</td>
55
        <td class="{$ressecondColStyle}">
56
        	<xsl:call-template name="i18n">
57
       			<xsl:with-param name="i18nElement" select="."/>
58
       		</xsl:call-template>
59
        </td>
60
      </tr>
61
      </xsl:if>
62
  </xsl:template>
63

    
64

    
65
  <!-- style the short name elements -->
66
  <xsl:template name="resourceshortName">
67
      <xsl:param name="resfirstColStyle"/>
68
      <xsl:param name="ressecondColStyle"/>
69
      <xsl:if test="normalize-space(.)!=''">
70
      <tr>
71
        <td class="{$resfirstColStyle}">Short Name:</td>
72
        <td class="{$ressecondColStyle}">
73
        	<xsl:call-template name="i18n">
74
       			<xsl:with-param name="i18nElement" select="."/>
75
       		</xsl:call-template>
76
        </td>
77
      </tr>
78
      </xsl:if>
79
  </xsl:template>
80

    
81

    
82
  <!-- style the title element -->
83
  <xsl:template name="resourcetitle" >
84
      <xsl:param name="resfirstColStyle"/>
85
      <xsl:param name="ressecondColStyle"/>
86
      <xsl:if test="normalize-space(.)!=''">
87
      <div class="control-group">
88
      	<label class="control-label">Title:</label>
89
        <div class="controls controls-well">
90
          <em class="bold">
91
       		<xsl:call-template name="i18n">
92
       			<xsl:with-param name="i18nElement" select="."/>
93
       		</xsl:call-template>	
94
          </em>
95
        </div>
96
      </div>
97
      </xsl:if>
98
  </xsl:template>
99

    
100
  <xsl:template name="resourcecreator" >
101
      <xsl:param name="resfirstColStyle"/>
102
      <tr><td colspan="2">
103
       <xsl:call-template name="party">
104
              <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
105
       </xsl:call-template>
106
      </td></tr>
107
   </xsl:template>
108

    
109
  <xsl:template name="resourcemetadataProvider" >
110
      <xsl:param name="resfirstColStyle"/>
111
      <tr><td colspan="2">
112
      <xsl:call-template name="party">
113
            <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
114
      </xsl:call-template>
115
      </td></tr>
116
  </xsl:template>
117

    
118
  <xsl:template name="resourceassociatedParty">
119
      <xsl:param name="resfirstColStyle"/>
120
      <tr><td colspan="2">
121
      <xsl:call-template name="party">
122
          <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
123
      </xsl:call-template>
124
      </td></tr>
125
  </xsl:template>
126

    
127

    
128
  <xsl:template name="resourcepubDate">
129
      <xsl:param name="resfirstColStyle"/>
130
      <xsl:if test="normalize-space(../pubDate)!=''">
131
      	<div class="control-group">
132
      		<label class="control-label">Publication Date:</label>
133
      		<div class="controls controls-well">
134
        		<xsl:value-of select="../pubDate"/>
135
      		</div>
136
      	</div>	
137
      </xsl:if>
138
  </xsl:template>
139

    
140

    
141
  <xsl:template name="resourcelanguage">
142
      <xsl:param name="resfirstColStyle"/>
143
      <xsl:if test="normalize-space(.)!=''">
144
      <tr>
145
      	<td class="{$resfirstColStyle}">
146
        	Language:
147
        </td>
148
        <td class="{$secondColStyle}">
149
        	<xsl:call-template name="i18n">
150
       			<xsl:with-param name="i18nElement" select="."/>
151
       		</xsl:call-template>
152
        </td>
153
        </tr>
154
      </xsl:if>
155
  </xsl:template>
156

    
157

    
158
  <xsl:template name="resourceseries">
159
      <xsl:param name="resfirstColStyle"/>
160
      <xsl:if test="normalize-space(../series)!=''">
161
      <tr><td class="{$resfirstColStyle}">
162
        Series:</td><td class="{$secondColStyle}">
163
        <xsl:value-of select="../series"/></td></tr>
164
      </xsl:if>
165
  </xsl:template>
166

    
167

    
168
  <xsl:template name="resourceabstract">
169
     <xsl:param name="resfirstColStyle"/>
170
     <xsl:param name="ressecondColStyle"/>
171
     <div class="control-group">
172
       <label class="control-label"><xsl:text>Abstract:</xsl:text></label>
173
       <div class="controls controls-well">
174
         <xsl:call-template name="text">
175
           <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
176
           <xsl:with-param name="textsecondColStyle" select="$ressecondColStyle"/>
177
         </xsl:call-template>
178
       </div>
179
     </div>
180
  </xsl:template>
181

    
182

    
183
  <!--<xsl:template match="keywordSet[1]" mode="resource">
184
        <xsl:param name="ressubHeaderStyle"/>
185
        <xsl:param name="resfirstColStyle"/>
186
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
187
        <xsl:text>Keywords:</xsl:text></td></tr>
188
        <xsl:call-template name="renderKeywordSet">
189
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
190
        </xsl:call-template>
191
  </xsl:template>-->
192

    
193
  <xsl:template name="resourcekeywordSet">
194
      <xsl:for-each select="keywordThesaurus">
195
        <xsl:if test="normalize-space(.)!=''">
196
          <xsl:value-of select="."/>
197
          <xsl:text>: </xsl:text>
198
        </xsl:if>
199
        <xsl:if test="normalize-space(keyword)!=''">
200
        <ul>
201
          <xsl:for-each select="keyword">
202
            <li>
203
            	<xsl:call-template name="i18n">
204
	       			<xsl:with-param name="i18nElement" select="."/>
205
	       		</xsl:call-template>
206
	            <xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
207
	              (<xsl:value-of select="./@keywordType"/>)
208
	            </xsl:if>
209
            </li>
210
          </xsl:for-each>
211
        </ul>
212
        </xsl:if>
213
      </xsl:for-each>
214
        <xsl:if test="normalize-space(keyword)!=''">
215
        <ul>
216
          <xsl:for-each select="keyword">
217
            <li>
218
            <xsl:call-template name="i18n">
219
       			<xsl:with-param name="i18nElement" select="."/>
220
       		</xsl:call-template>
221
            <xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
222
              (<xsl:value-of select="./@keywordType"/>)
223
            </xsl:if>
224
            </li>
225
          </xsl:for-each>
226
        </ul>
227
        </xsl:if>
228
  </xsl:template>
229

    
230
   <xsl:template name="resourceadditionalInfo">
231
     <xsl:param name="ressubHeaderStyle"/>
232
     <xsl:param name="resfirstColStyle"/>
233
     <tr><td class="{$ressubHeaderStyle}" colspan="2">
234
        <xsl:text>Additional Information:</xsl:text>
235
     </td></tr>
236
     <tr><td class="{$resfirstColStyle}">&#160;</td>
237
         <td>
238
           <xsl:call-template name="text">
239
             <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
240
           </xsl:call-template>
241
         </td>
242
     </tr>
243
  </xsl:template>
244

    
245

    
246
   <xsl:template name="resourceintellectualRights">
247
     <xsl:param name="resfirstColStyle"/>
248
     <xsl:param name="ressecondColStyle"/>
249
       <xsl:call-template name="text">
250
         <xsl:with-param name="textsecondColStyle" select="$ressecondColStyle"/>
251
       </xsl:call-template>
252
  </xsl:template>
253

    
254
   <xsl:template name="resourcedistribution">
255
     <xsl:param name="ressubHeaderStyle"/>
256
     <xsl:param name="resfirstColStyle"/>
257
     <xsl:param name="index"/>
258
     <xsl:param name="docid"/>
259
     <tr><td colspan="2">
260
        <xsl:call-template name="distribution">
261
          <xsl:with-param name="disfirstColStyle" select="$resfirstColStyle"/>
262
          <xsl:with-param name="dissubHeaderStyle" select="$ressubHeaderStyle"/>
263
          <xsl:with-param name="level">toplevel</xsl:with-param>
264
          <xsl:with-param name="distributionindex" select="$index"/>
265
          <xsl:with-param name="docid" select="$docid"/>
266
        </xsl:call-template>
267
     </td></tr>
268
  </xsl:template>
269

    
270
  <xsl:template name="resourcecoverage">
271
     <xsl:param name="ressubHeaderStyle"/>
272
     <xsl:param name="resfirstColStyle"/>
273
     <tr><td colspan="2">
274
        <xsl:call-template name="coverage">
275
        </xsl:call-template>
276
     </td></tr>
277
  </xsl:template>
278
  
279
	<!-- for displaying any nested translation element for i18nNonEmptyString type -->
280
	<xsl:template name="i18n">
281
		<xsl:param name="i18nElement"/>
282
		<!-- the primary value -->
283
		<xsl:if test="$i18nElement/text() != ''">
284
			<xsl:if test="./@xml:lang != ''">
285
				(<xsl:value-of select="./@xml:lang"/>)
286
			</xsl:if>
287
			<xsl:value-of select="$i18nElement/."/>
288
		</xsl:if>
289
		<!-- any translations -->
290
		<xsl:if test="count($i18nElement/value) > 0">
291
			<br/>
292
			<xsl:for-each select="$i18nElement/value">
293
				<xsl:if test="./@xml:lang != ''">
294
					(<xsl:value-of select="./@xml:lang"/>)
295
				</xsl:if>
296
				<xsl:value-of select="."/>
297
				<xsl:if test="position() != last()">
298
					<br/>
299
				</xsl:if>	
300
			</xsl:for-each>
301
		</xsl:if>
302
	</xsl:template>
303

    
304

    
305
</xsl:stylesheet>
(19-19/27)