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

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

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

    
210
  <xsl:template name="resourcecreator" >
211
      <xsl:param name="resfirstColStyle"/>
212
      <tr><td colspan="2">
213
       <xsl:call-template name="party">
214
              <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
215
       </xsl:call-template>
216
      </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
  </xsl:template>  
241
  
242
  
243
  <!--<xsl:template match="associateParty[1]" mode="resource">
244
    <xsl:param name="ressubHeaderStyle"/>
245
    <xsl:param name="resfirstColStyle"/>
246
    <tr><td class="{$ressubHeaderStyle}" colspan="2">
247
      <xsl:text>Associate Party(s):</xsl:text>
248
    </td></tr>
249
    <tr><td colspan="2">
250
    <xsl:call-template name="party">
251
            <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
252
    </xsl:call-template>
253
    </td></tr>
254
    <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
255
        <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
256
    </td></tr>
257
  </xsl:template>-->
258

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

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

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

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

    
298

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

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

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

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

    
373
   
374
   <xsl:template name="resourceintellectualRights">
375
     <xsl:param name="ressubHeaderStyle"/>
376
     <xsl:param name="resfirstColStyle"/>
377
     <tr><td class="{$ressubHeaderStyle}" colspan="2">
378
        <xsl:text>License and Usage Rights:</xsl:text>
379
     </td></tr>
380
     <tr><td width="{$firstColWidth}" class="{$resfirstColStyle}">&#160;</td>
381
         <td width="{$secondColWidth}">  
382
           <xsl:call-template name="text">
383
             <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
384
           </xsl:call-template>
385
         </td>
386
     </tr>
387
  </xsl:template>
388
  
389
   <xsl:template name="resourcedistribution">
390
     <xsl:param name="ressubHeaderStyle"/>
391
     <xsl:param name="resfirstColStyle"/>
392
     <xsl:param name="index"/>
393
     <xsl:param name="docid"/>
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:with-param name="level">toplevel</xsl:with-param>
399
          <xsl:with-param name="distributionindex" select="$index"/>
400
          <xsl:with-param name="docid" select="$docid"/>
401
        </xsl:call-template>
402
     </td></tr>  
403
  </xsl:template>
404
  
405
  <xsl:template name="resourcecoverage">
406
     <xsl:param name="ressubHeaderStyle"/>
407
     <xsl:param name="resfirstColStyle"/>
408
     <tr><td colspan="2" width="100%">    
409
        <xsl:call-template name="coverage">
410
        </xsl:call-template>
411
     </td></tr>  
412
  </xsl:template>
413

    
414

    
415
</xsl:stylesheet>
(22-22/30)