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-22 16:04:41 -0700 (Sun, 22 Jun 2003) $'
11
  * '$Revision: 1684 $'
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:with-param name="index" select="position()"/>
150
        </xsl:call-template>
151
      </xsl:for-each>
152
    </table>
153
    
154
    <xsl:for-each select="coverage">
155
      <xsl:call-template name="resourcecoverage">
156
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
157
          <xsl:with-param name="ressubHeaderStyle" select="$ressubHeaderStyle"/>
158
      </xsl:call-template>
159
    </xsl:for-each>
160
    
161
  </xsl:template>
162
  
163
  <xsl:template name="resourcealternateIdentifier" >
164
      <xsl:param name="resfirstColStyle"/>
165
      <xsl:if test="normalize-space(.)!=''">
166
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
167
        Alternate Identifier:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
168
        <xsl:value-of select="."/></td></tr>
169
      </xsl:if>
170
  </xsl:template>
171
  
172

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

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

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

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

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

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

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

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

    
305

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

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

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

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

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

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

    
415

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