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: tao $'
10
  *     '$Date: 2003-06-20 20:21:39 -0700 (Fri, 20 Jun 2003) $'
11
  * '$Revision: 1679 $'
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-2.0.0.xsl"/>
34
  <xsl:import href="eml-distribution-2.0.0.xsl"/>
35
  <xsl:import href="eml-coverage-2.0.0.xsl"/>-->
36
  <xsl:output method="html" encoding="iso-8859-1"/>
37
  
38
  <!-- This module is for resouce and it is self-contained (it is table)-->
39
  <xsl:template name="resource">
40
    <xsl:param name="resfirstColStyle"/>
41
    <xsl:param name="ressubHeaderStyle"/>
42
    <xsl:param name="creator">Data Set Owner(s):</xsl:param>
43
    <table class="tabledefault" width="100%">
44
      <xsl:for-each select="alternateIdentifier">
45
        <xsl:call-template name="resourcealternateIdentifier">
46
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
47
        </xsl:call-template>
48
      </xsl:for-each>
49
      
50
      <xsl:for-each select="shortName">
51
        <xsl:call-template name="resourceshortName">
52
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
53
         </xsl:call-template>
54
      </xsl:for-each>
55
      
56
      <xsl:for-each select="title">
57
        <xsl:call-template name="resourcetitle">
58
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
59
          <xsl:with-param name="ressubHeaderStyle" select="$ressubHeaderStyle"/>
60
        </xsl:call-template>
61
      </xsl:for-each>
62
      
63
      <xsl:if test="creator">
64
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
65
        <xsl:value-of select="$creator"/>
66
      </td></tr>
67
      </xsl:if>
68
      <xsl:for-each select="creator">
69
        <xsl:call-template name="resourcecreator">
70
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
71
        </xsl:call-template>
72
      </xsl:for-each>
73
      
74
      <xsl:if test="metadataProvider">
75
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
76
        <xsl:text>Metadata Provider(s):</xsl:text>
77
      </td></tr>
78
      </xsl:if>
79
       <xsl:for-each select="metadataProvider">
80
        <xsl:call-template name="resourcemetadataProvider">
81
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
82
        </xsl:call-template>
83
      </xsl:for-each>
84
      
85
      <xsl:if test="associatedParty">
86
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
87
             <xsl:text>Associate Party:</xsl:text>
88
         </td></tr>
89
      </xsl:if>
90
      <xsl:for-each select="associatedParty">
91
        <xsl:call-template name="resourceassociatedParty">
92
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
93
        </xsl:call-template>
94
      </xsl:for-each>
95
      
96
      <xsl:for-each select="pubDate">
97
        <xsl:call-template name="resourcepubDate" >
98
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
99
         </xsl:call-template>
100
      </xsl:for-each>
101
      
102
      <xsl:for-each select="language">
103
        <xsl:call-template name="resourcelanguage" >
104
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
105
         </xsl:call-template>
106
      </xsl:for-each>
107
      
108
      <xsl:for-each select="series">
109
        <xsl:call-template name="resourceseries" >
110
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
111
        </xsl:call-template>
112
      </xsl:for-each>
113
      
114
      <xsl:for-each select="abstract">
115
        <xsl:call-template name="resourceabstract" >
116
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
117
          <xsl:with-param name="ressubHeaderStyle" select="$ressubHeaderStyle"/>
118
        </xsl:call-template>
119
      </xsl:for-each>
120
      
121
      <xsl:if test="keywordSet">
122
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
123
             <xsl:text>Keywords:</xsl:text></td></tr>
124
      </xsl:if>
125
      <xsl:for-each select="keywordSet">
126
        <xsl:call-template name="resourcekeywordSet" >
127
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
128
        </xsl:call-template>
129
      </xsl:for-each>
130
      
131
      <xsl:for-each select="additionalInfo">
132
        <xsl:call-template name="resourceadditionalInfo" >
133
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
134
          <xsl:with-param name="ressubHeaderStyle" select="$ressubHeaderStyle"/>
135
        </xsl:call-template>
136
      </xsl:for-each>
137
      
138
      <xsl:for-each select="intellectualRights">
139
        <xsl:call-template name="resourceintellectualRights" >
140
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
141
          <xsl:with-param name="ressubHeaderStyle" select="$ressubHeaderStyle"/>
142
        </xsl:call-template>
143
      </xsl:for-each>
144
      
145
      <xsl:for-each select="distribution">
146
        <xsl:call-template name="resourcedistribution">
147
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
148
          <xsl:with-param name="ressubHeaderStyle" select="$ressubHeaderStyle"/>
149
        </xsl:call-template>
150
      </xsl:for-each>
151
    </table>
152
    
153
    <xsl:for-each select="coverage">
154
      <xsl:call-template name="resourcecoverage">
155
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
156
          <xsl:with-param name="ressubHeaderStyle" select="$ressubHeaderStyle"/>
157
      </xsl:call-template>
158
    </xsl:for-each>
159
    
160
  </xsl:template>
161
  
162
  <xsl:template name="resourcealternateIdentifier" >
163
      <xsl:param name="resfirstColStyle"/>
164
      <xsl:if test="normalize-space(.)!=''">
165
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
166
        Alternate Identifier:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
167
        <xsl:value-of select="."/></td></tr>
168
      </xsl:if>
169
  </xsl:template>
170
  
171

    
172
  <xsl:template name="resourceshortName">
173
      <xsl:param name="resfirstColStyle"/>
174
      <xsl:if test="normalize-space(.)!=''">
175
      <tr><td width="{$firstColWidth}"  class="{$resfirstColStyle}" >
176
        Short Name:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
177
        <xsl:value-of select="."/></td></tr>
178
      </xsl:if>
179
  </xsl:template>
180

    
181
  
182
  <xsl:template name="resourcetitle" >
183
      <xsl:param name="resfirstColStyle"/>
184
      <xsl:if test="normalize-space(.)!=''">
185
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
186
        Title:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
187
        <xsl:value-of select="."/></td></tr>
188
      </xsl:if>
189
  </xsl:template>
190
  
191
 
192
  <!--<xsl:template match="creator[1]" mode="resource">
193
    <xsl:param name="ressubHeaderStyle"/>
194
    <xsl:param name="resfirstColStyle"/>
195
    <tr><td class="{$ressubHeaderStyle}" colspan="2">
196
      <xsl:text>Data Set Owner(s):</xsl:text>
197
    </td></tr>
198
    <tr><td colspan="2">
199
    <xsl:call-template  name="party">
200
      <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
201
    </xsl:call-template>
202
    </td></tr>
203
    <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
204
        <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
205
    </td></tr>
206
  </xsl:template>-->
207

    
208
  <xsl:template name="resourcecreator" >
209
      <xsl:param name="resfirstColStyle"/>
210
      <tr><td colspan="2">
211
       <xsl:call-template name="party">
212
              <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
213
       </xsl:call-template>
214
      </td></tr>
215
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
216
       <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td></tr>
217
  </xsl:template> 
218
    
219
  <!--<xsl:template match="metadataProvider[1]" mode="resource">
220
    <xsl:param name="ressubHeaderStyle"/>
221
    <xsl:param name="resfirstColStyle"/>
222
    <tr><td class="{$ressubHeaderStyle}" colspan="2">
223
          <xsl:text>Metadata Provider(s):</xsl:text></td></tr>
224
    <tr><td colspan="2">
225
    <xsl:call-template name="party">
226
      <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
227
    </xsl:call-template>
228
    </td></tr>
229
    <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
230
    <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td></tr>
231
  </xsl:template>-->
232

    
233
  <xsl:template name="resourcemetadataProvider" >
234
      <xsl:param name="resfirstColStyle"/>
235
      <tr><td colspan="2">
236
      <xsl:call-template name="party">
237
            <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
238
      </xsl:call-template>
239
      </td></tr>
240
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
241
        <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
242
      </td></tr>
243
  </xsl:template>  
244
  
245
  
246
  <!--<xsl:template match="associateParty[1]" mode="resource">
247
    <xsl:param name="ressubHeaderStyle"/>
248
    <xsl:param name="resfirstColStyle"/>
249
    <tr><td class="{$ressubHeaderStyle}" colspan="2">
250
      <xsl:text>Associate Party(s):</xsl:text>
251
    </td></tr>
252
    <tr><td colspan="2">
253
    <xsl:call-template name="party">
254
            <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
255
    </xsl:call-template>
256
    </td></tr>
257
    <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
258
        <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
259
    </td></tr>
260
  </xsl:template>-->
261

    
262
  <xsl:template name="resourceassociateParty">
263
      <xsl:param name="resfirstColStyle"/>
264
      <tr><td colspan="2">
265
      <xsl:call-template name="party">
266
          <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
267
      </xsl:call-template>
268
      </td></tr>
269
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
270
        <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
271
      </td></tr>
272
  </xsl:template>  
273

    
274
 
275
  <xsl:template name="resourcepubDate">
276
      <xsl:param name="resfirstColStyle"/>
277
      <xsl:if test="normalize-space(../pubDate)!=''">
278
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
279
        Publication Date:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
280
        <xsl:value-of select="../pubDate"/></td></tr>
281
      </xsl:if>
282
  </xsl:template> 
283

    
284
 
285
  <xsl:template name="resourcelanguage">
286
      <xsl:param name="resfirstColStyle"/>
287
      <xsl:if test="normalize-space(.)!=''">
288
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
289
        Language:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
290
        <xsl:value-of select="."/></td></tr>
291
      </xsl:if>
292
  </xsl:template>  
293

    
294
  
295
  <xsl:template name="resourceseries">
296
      <xsl:param name="resfirstColStyle"/>
297
      <xsl:if test="normalize-space(../series)!=''">
298
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
299
        Series:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
300
        <xsl:value-of select="../series"/></td></tr>
301
      </xsl:if>
302
  </xsl:template>
303

    
304

    
305
  <xsl:template name="resourceabstract">
306
     <xsl:param name="resfirstColStyle"/>
307
     <xsl:param name="ressubHeaderStyle"/>
308
     <tr><td class="{$ressubHeaderStyle}" colspan="2">
309
        <xsl:text>Abstract:</xsl:text>
310
     </td></tr>
311
     <tr><td colspan="2" width="100%">
312
        <xsl:call-template name="text">
313
          <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
314
        </xsl:call-template>
315
     </td></tr>
316
     <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
317
     <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td></tr>
318
  </xsl:template>
319

    
320
 
321
  <!--<xsl:template match="keywordSet[1]" mode="resource">
322
        <xsl:param name="ressubHeaderStyle"/>
323
        <xsl:param name="resfirstColStyle"/>
324
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
325
        <xsl:text>Keywords:</xsl:text></td></tr>
326
        <xsl:call-template name="renderKeywordSet">
327
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
328
        </xsl:call-template>
329
  </xsl:template>-->
330

    
331
  <xsl:template name="resourcekeywordSet">
332
        <xsl:param name="resfirstColStyle"/> 
333
        <xsl:call-template name="renderKeywordSet">
334
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
335
        </xsl:call-template>
336
  </xsl:template>
337

    
338
  <xsl:template name="renderKeywordSet">
339
    <xsl:param name="resfirstColStyle"/>
340
    <xsl:for-each select="keywordThesaurus">
341
    <xsl:if test="normalize-space(.)!=''">
342
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
343
        <xsl:text>Thesaurus:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
344
        <xsl:value-of select="."/></td></tr>
345
    </xsl:if>
346
    </xsl:for-each>
347
    <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;
348
        </td><td width="{$secondColWidth}" class="indent-col">
349
      <xsl:if test="normalize-space(keyword)!=''">
350
      <UL>
351
        <xsl:for-each select="keyword">
352
          <LI><xsl:value-of select="."/>
353
          <xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
354
            (<xsl:value-of select="./@keywordType"/>)
355
          </xsl:if>
356
          </LI>
357
        </xsl:for-each>
358
      </UL>
359
      </xsl:if>
360
    </td></tr>
361
  </xsl:template>
362

    
363
     
364
   <xsl:template name="resourceadditionalInfo">
365
     <xsl:param name="ressubHeaderStyle"/>
366
     <xsl:param name="resfirstColStyle"/>
367
     <tr><td class="{$ressubHeaderStyle}" colspan="2">
368
        <xsl:text>Additional Information:</xsl:text>
369
     </td></tr>
370
     <tr><td colspan="2" width="100%">    
371
        <xsl:call-template name="text">
372
          <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
373
        </xsl:call-template>
374
     </td></tr>
375
  </xsl:template>
376

    
377
   
378
   <xsl:template name="resourceintellectualRights">
379
     <xsl:param name="ressubHeaderStyle"/>
380
     <xsl:param name="resfirstColStyle"/>
381
     <tr><td class="{$ressubHeaderStyle}" colspan="2">
382
        <xsl:text>License and Usage Rights:</xsl:text>
383
     </td></tr>
384
     <tr><td colspan="2" width="100%">    
385
        <xsl:call-template name="text">
386
          <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
387
        </xsl:call-template>
388
     </td></tr>  
389
  </xsl:template>
390
  
391
   <xsl:template name="resourcedistribution">
392
     <xsl:param name="ressubHeaderStyle"/>
393
     <xsl:param name="resfirstColStyle"/>
394
     <tr><td colspan="2" width="100%">    
395
        <xsl:call-template name="distribution">
396
          <xsl:with-param name="disfirstColStyle" select="$resfirstColStyle"/>
397
          <xsl:with-param name="dissubHeaderStyle" select="$ressubHeaderStyle"/>
398
        </xsl:call-template>
399
     </td></tr>  
400
  </xsl:template>
401
  
402
  <xsl:template name="resourcecoverage">
403
     <xsl:param name="ressubHeaderStyle"/>
404
     <xsl:param name="resfirstColStyle"/>
405
     <tr><td colspan="2" width="100%">    
406
        <xsl:call-template name="coverage">
407
        </xsl:call-template>
408
     </td></tr>  
409
  </xsl:template>
410

    
411

    
412
</xsl:stylesheet>
(22-22/33)