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-07-17 17:48:51 -0700 (Thu, 17 Jul 2003) $'
11
  * '$Revision: 1735 $'
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 xsl:use-attribute-sets="cellspacing" 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:for-each select="pubDate">
64
        <xsl:call-template name="resourcepubDate" >
65
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
66
         </xsl:call-template>
67
      </xsl:for-each>
68
      
69
      <xsl:for-each select="language">
70
        <xsl:call-template name="resourcelanguage" >
71
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
72
         </xsl:call-template>
73
      </xsl:for-each>
74
      
75
      <xsl:for-each select="series">
76
        <xsl:call-template name="resourceseries" >
77
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
78
        </xsl:call-template>
79
      </xsl:for-each>
80
      
81
      <xsl:if test="creator">
82
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
83
        <xsl:value-of select="$creator"/>
84
      </td></tr>
85
      </xsl:if>
86
      <xsl:for-each select="creator">
87
        <xsl:call-template name="resourcecreator">
88
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
89
        </xsl:call-template>
90
      </xsl:for-each>
91
      
92
      <xsl:if test="metadataProvider">
93
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
94
        <xsl:text>Metadata Provider(s):</xsl:text>
95
      </td></tr>
96
      </xsl:if>
97
       <xsl:for-each select="metadataProvider">
98
        <xsl:call-template name="resourcemetadataProvider">
99
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
100
        </xsl:call-template>
101
      </xsl:for-each>
102
      
103
      <xsl:if test="associatedParty">
104
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
105
             <xsl:text>Associate Party:</xsl:text>
106
         </td></tr>
107
      </xsl:if>
108
      <xsl:for-each select="associatedParty">
109
        <xsl:call-template name="resourceassociatedParty">
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
        <b><xsl:value-of select="."/></b></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
   </xsl:template> 
217
    
218
  <!--<xsl:template match="metadataProvider[1]" mode="resource">
219
    <xsl:param name="ressubHeaderStyle"/>
220
    <xsl:param name="resfirstColStyle"/>
221
    <tr><td class="{$ressubHeaderStyle}" colspan="2">
222
          <xsl:text>Metadata Provider(s):</xsl:text></td></tr>
223
    <tr><td colspan="2">
224
    <xsl:call-template name="party">
225
      <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
226
    </xsl:call-template>
227
    </td></tr>
228
    <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
229
    <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td></tr>
230
  </xsl:template>-->
231

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

    
258
  <xsl:template name="resourceassociatedParty">
259
      <xsl:param name="resfirstColStyle"/>
260
      <tr><td colspan="2">
261
      <xsl:call-template name="party">
262
          <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
263
      </xsl:call-template>
264
      </td></tr>
265
  </xsl:template>  
266

    
267
 
268
  <xsl:template name="resourcepubDate">
269
      <xsl:param name="resfirstColStyle"/>
270
      <xsl:if test="normalize-space(../pubDate)!=''">
271
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
272
        Publication Date:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
273
        <xsl:value-of select="../pubDate"/></td></tr>
274
      </xsl:if>
275
  </xsl:template> 
276

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

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

    
297

    
298
  <xsl:template name="resourceabstract">
299
     <xsl:param name="resfirstColStyle"/>
300
     <xsl:param name="ressubHeaderStyle"/>
301
     <tr><td class="{$ressubHeaderStyle}" colspan="2">
302
        <xsl:text>Abstract:</xsl:text>
303
     </td></tr>
304
     <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
305
         <td width="{$secondColWidth}">  
306
           <xsl:call-template name="text">
307
             <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
308
           </xsl:call-template>
309
         </td>
310
     </tr>
311
  </xsl:template>
312

    
313
 
314
  <!--<xsl:template match="keywordSet[1]" mode="resource">
315
        <xsl:param name="ressubHeaderStyle"/>
316
        <xsl:param name="resfirstColStyle"/>
317
        <tr><td class="{$ressubHeaderStyle}" colspan="2">
318
        <xsl:text>Keywords:</xsl:text></td></tr>
319
        <xsl:call-template name="renderKeywordSet">
320
          <xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
321
        </xsl:call-template>
322
  </xsl:template>-->
323

    
324
  <xsl:template name="resourcekeywordSet">
325
        <xsl:param name="resfirstColStyle"/> 
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="renderKeywordSet">
332
    <xsl:param name="resfirstColStyle"/>
333
    <xsl:for-each select="keywordThesaurus">
334
    <xsl:if test="normalize-space(.)!=''">
335
      <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">
336
        <xsl:text>Thesaurus:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
337
        <xsl:value-of select="."/></td></tr>
338
    </xsl:if>
339
    </xsl:for-each>
340
    <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;
341
        </td><td width="{$secondColWidth}" class="indent-col">
342
      <xsl:if test="normalize-space(keyword)!=''">
343
      <UL>
344
        <xsl:for-each select="keyword">
345
          <LI><xsl:value-of select="."/>
346
          <xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
347
            (<xsl:value-of select="./@keywordType"/>)
348
          </xsl:if>
349
          </LI>
350
        </xsl:for-each>
351
      </UL>
352
      </xsl:if>
353
    </td></tr>
354
  </xsl:template>
355

    
356
     
357
   <xsl:template name="resourceadditionalInfo">
358
     <xsl:param name="ressubHeaderStyle"/>
359
     <xsl:param name="resfirstColStyle"/>
360
     <tr><td class="{$ressubHeaderStyle}" colspan="2">
361
        <xsl:text>Additional Information:</xsl:text>
362
     </td></tr>
363
     <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
364
         <td width="{$secondColWidth}">  
365
           <xsl:call-template name="text">
366
             <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
367
           </xsl:call-template>
368
         </td>
369
     </tr>
370
  </xsl:template>
371

    
372
   
373
   <xsl:template name="resourceintellectualRights">
374
     <xsl:param name="ressubHeaderStyle"/>
375
     <xsl:param name="resfirstColStyle"/>
376
     <tr><td class="{$ressubHeaderStyle}" colspan="2">
377
        <xsl:text>License and Usage Rights:</xsl:text>
378
     </td></tr>
379
     <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
380
         <td width="{$secondColWidth}">  
381
           <xsl:call-template name="text">
382
             <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
383
           </xsl:call-template>
384
         </td>
385
     </tr>
386
  </xsl:template>
387
  
388
   <xsl:template name="resourcedistribution">
389
     <xsl:param name="ressubHeaderStyle"/>
390
     <xsl:param name="resfirstColStyle"/>
391
     <xsl:param name="index"/>
392
     <tr><td colspan="2" width="100%">    
393
        <xsl:call-template name="distribution">
394
          <xsl:with-param name="disfirstColStyle" select="$resfirstColStyle"/>
395
          <xsl:with-param name="dissubHeaderStyle" select="$ressubHeaderStyle"/>
396
          <xsl:with-param name="level">toplevel</xsl:with-param>
397
          <xsl:with-param name="distributionindex" select="$index"/>
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>
(23-23/30)