Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Chad Berkley, Matt Jones
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: jones $'
10
  *     '$Date: 2001-09-13 16:22:00 -0700 (Thu, 13 Sep 2001) $'
11
  * '$Revision: 827 $'
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
-->
28
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
29
  <xsl:output method="html" />
30
  <xsl:template match="/"> 
31
    <html>
32
    <head>
33
      <link rel="stylesheet" type="text/css" 
34
       href="@style-path@/rowcol.css" />
35
      <title>
36
        <xsl:value-of select="//title" />
37
      </title>
38
    </head>
39
    <body bgcolor="white">
40
      <h1><xsl:value-of select="//title" /></h1>
41
      <xsl:if test="count(//alternateTitle) &gt; 0">
42
        <h2><xsl:value-of select="//alternateTitle" /></h2>
43
      </xsl:if>
44
      
45
      <!-- display the literature specific fields if they are present -->
46
      <xsl:if test="count(resource/literature/ISBN) &gt; 0">
47
        <h2>ISBN: <xsl:value-of select="resource/literature/ISBN" /></h2>
48
      </xsl:if>
49
      <xsl:if test="count(resource/literature/editor) &gt; 0">
50
        <xsl:for-each select="resource/literature/editor">
51
          <h2>editor: <xsl:value-of select="resource/literature/editor" /></h2>
52
        </xsl:for-each>
53
      </xsl:if>
54
      <xsl:if test="count(resource/literature/edition) &gt; 0">
55
        <h2>edition: <xsl:value-of select="resource/literature/edition" /></h2>
56
      </xsl:if>
57
      <xsl:if test="count(resource/literature/volume) &gt; 0">
58
        <h2>volume: <xsl:value-of select="resource/literature/volume" /></h2>
59
      </xsl:if>
60
      <xsl:if test="count(resource/literature/ISBN) &gt; 0">
61
        <h2>ISBN: <xsl:value-of select="resource/literature/ISBN" /></h2>
62
      </xsl:if>
63
      
64
      <!-- display the contact information -->
65
      <h3 class="highlight">Contacts</h3>
66
      
67
      <xsl:for-each select="resource/*/originator">
68
        <u>
69
        <xsl:value-of select="./individualName/salutation" />&nbsp;
70
        <xsl:value-of select="./individualName/givenName" />&nbsp;
71
        <xsl:value-of select="./individualName/surName" />&nbsp;
72
        </u>
73
        <br />
74
        <dir>
75
        <xsl:text>Role: </xsl:text>
76
        <xsl:value-of select="./roleCode" /><br/>
77
        <xsl:if test="count(resource/*/organizationName) &gt; 0">
78
          <xsl:value-of select="./organizationName" />
79
          <br />
80
        </xsl:if>
81
        
82
        <xsl:if test="count(./contactInfo/phone/voice) &gt; 0">
83
          Phone:&nbsp;
84
          <xsl:for-each select="./contactInfo/phone/voice">
85
           <xsl:value-of select="." />
86
            <br />
87
          </xsl:for-each>
88
        </xsl:if>
89
        
90
        <xsl:if test="count(./contactInfo/phone/facsimile) &gt; 0">
91
          Fax:&nbsp;
92
          <xsl:for-each select="./contactInfo/phone/facsimile">
93
            <xsl:value-of select="." />
94
            <br />
95
          </xsl:for-each>
96
        </xsl:if>
97
        
98
        <xsl:if test="count(./contactInfo/phone/other) &gt; 0">
99
          Other phone:&nbsp;
100
          <xsl:for-each select="./contactInfo/phone/other">
101
            <xsl:value-of select="." />
102
            &nbsp;&nbsp;
103
            <xsl:text>Number type:</xsl:text>
104
            <xsl:value-of select="/resource/*/*/contactInfo/phone/otherType" />
105
            <br />
106
          </xsl:for-each>
107
        </xsl:if>
108
        
109
        <xsl:if test="count(./contactInfo/address) &gt; 0">
110
          <xsl:value-of select="./contactInfo/address/deliveryPoint" /><br/>
111
          <xsl:value-of select="./contactInfo/address/city" />,&nbsp;
112
          <xsl:value-of select="./contactInfo/address/administrativeArea" />&nbsp;
113
          <xsl:value-of select="./contactInfo/address/postalCode" />&nbsp;<br/>
114
          <xsl:value-of select="./contactInfo/address/country" /><br/>
115
          <xsl:value-of select="./contactInfo/address/electronicMailAddress" />
116
          <br/>
117
        </xsl:if>
118
          
119
        <xsl:if test="count(./onlineResource) &gt; 0">
120
          <xsl:value-of select="./onlineResource/linkage/URL" /><br/>
121
          <xsl:value-of select="./onlineResource/protocol" /><br/>
122
          <xsl:value-of select="./onlineResource/applicationProtocol" /><br/>
123
          <xsl:value-of select="./onlineResource/linkage/name" /><br/>
124
          <xsl:value-of select="./onlineResource/linkage/description" /><br/>
125
          <xsl:value-of select="./onlineResource/linkage/functionCode" /><br/>
126
          <br />
127
        </xsl:if>
128
        
129
        <xsl:if test="count(./contactInfo/hoursOfService) &gt; 0">
130
          Office hours:&nbsp;
131
          <xsl:value-of select="./contactInfo/hoursOfService" />
132
          <br/>
133
        </xsl:if>
134
        
135
        <xsl:if test="count(./contactInfo/contactInstructions) &gt; 0">
136
          Contact instructions:&nbsp;
137
          <xsl:value-of select="./contactInfo/contactInstructions" />
138
          <br/>
139
        </xsl:if>
140
        
141
        <br/>
142
        </dir>
143
      </xsl:for-each>
144
      
145
      <xsl:if test="count(resource/*/publisher) &gt; 0">
146
        <h3 class="highlight">Publishing Information</h3>
147
        Publisher:
148
        
149
        <xsl:value-of select="resource/*/publisher/individualName/salutation" />
150
        &nbsp;
151
        <xsl:value-of select="resource/*/publisher/individualName/givenName" />&nbsp;
152
        <xsl:value-of select="resource/*/publisher/individualName/surName" />&nbsp;
153
        <br />
154
        <xsl:if test="count(resource/*/publisher/organizationName) &gt; 0">
155
          <xsl:value-of select="resource/*/publisher/organizationName" />
156
          <br />
157
        </xsl:if>
158
        
159
        <xsl:if test="count(resource/*/publisher/contactInfo/phone/voice) &gt; 0">
160
          Phone:&nbsp;
161
          <xsl:for-each select="resource/*/publisher/contactInfo/phone/voice">
162
           <xsl:value-of select="." />
163
            <br />
164
          </xsl:for-each>
165
        </xsl:if>
166
        
167
        <xsl:if test="count(resource/*/publisher/contactInfo/phone/facsimile) &gt; 0">
168
          Fax:&nbsp;
169
          <xsl:for-each select="resource/*/publisher/contactInfo/phone/facsimile">
170
            <xsl:value-of select="." />
171
            <br />
172
          </xsl:for-each>
173
        </xsl:if>
174
        
175
        <xsl:if test="count(resource/*/publisher/contactInfo/phone/other) &gt; 0">
176
          Other phone:&nbsp;
177
          <xsl:for-each select="resource/*/publisher/contactInfo/phone/other">
178
            <xsl:value-of select="." />
179
            &nbsp;&nbsp;
180
            <xsl:text>Number type:</xsl:text>
181
            <xsl:value-of select="/resource/*/*/contactInfo/phone/otherType" />
182
            <br />
183
          </xsl:for-each>
184
        </xsl:if>
185
        
186
        <xsl:if test="count(resource/*/publisher/contactInfo/address) &gt; 0">
187
          <xsl:value-of 
188
           select="resource/*/publisher/contactInfo/address/deliveryPoint" />
189
           <br/>
190
          <xsl:value-of 
191
           select="resource/*/publisher/contactInfo/address/city" />,&nbsp;
192
          <xsl:value-of 
193
           select="resource/*/publisher/contactInfo/address/administrativeArea"/>
194
           &nbsp;
195
          <xsl:value-of 
196
           select="resource/*/publisher/contactInfo/address/postalCode" />
197
           &nbsp;<br/>
198
          <xsl:value-of 
199
           select="resource/*/publisher/contactInfo/address/country" /><br/>
200
          <xsl:value-of 
201
           select="resource/*/publisher/contactInfo/address/electronicMailAddress" />
202
          <br/>
203
        </xsl:if>
204
          
205
        <xsl:if test="count(resource/*/publisher/onlineResource) &gt; 0">
206
          <xsl:value-of 
207
           select="resource/*/publisher/onlineResource/linkage/URL" /><br/>
208
          <xsl:value-of 
209
           select="resource/*/publisher/onlineResource/protocol" /><br/>
210
          <xsl:value-of 
211
           select="resource/*/publisher/onlineResource/applicationProtocol" />
212
           <br/>
213
          <xsl:value-of 
214
           select="resource/*/publisher/onlineResource/linkage/name" /><br/>
215
          <xsl:value-of 
216
           select="resource/*/publisher/onlineResource/linkage/description" />
217
           <br/>
218
          <xsl:value-of 
219
           select="resource/*/publisher/onlineResource/linkage/functionCode" />
220
           <br/>
221
          <br />
222
        </xsl:if>
223
        
224
        <xsl:if 
225
         test="count(resource/*/publisher/contactInfo/hoursOfService) &gt; 0">
226
          Office hours:&nbsp;
227
          <xsl:value-of 
228
           select="resource/*/publisher/contactInfo/hoursOfService" />
229
          <br/>
230
        </xsl:if>
231
        
232
        <xsl:if 
233
         test="count(resource/*/publisher/contactInfo/contactInstructions) &gt; 0">
234
          Contact instructions:&nbsp;
235
          <xsl:value-of 
236
           select="resource/*/publisher/contactInfo/contactInstructions" />
237
          <br/>
238
        </xsl:if>
239
      </xsl:if>
240
      
241
      <xsl:if test="count(resource/*/pubdate) &gt; 0">
242
        Publishing Date:
243
        &nbsp; <xsl:value-of select="resource/*/pubdate" /><br/>
244
      </xsl:if>
245
      
246
      <xsl:if test="count(resource/*/pubplace) &gt; 0">
247
        Publishing Place: 
248
        &nbsp; <xsl:value-of select="resource/*/pubplace" />
249
        <br/>
250
      </xsl:if>
251
      
252
      <xsl:if test="count(resource/*/series) &gt; 0">
253
        Series:&nbsp; <xsl:value-of select="resource/*/series" /><br/>
254
      </xsl:if>
255
      
256
      <xsl:if test="count(resource/*/additionalInfo) &gt; 0">
257
        <h3 class="highlight">Other Information</h3>
258
        Additional Information:
259
        &nbsp; <xsl:value-of select="resource/*/additionalInfo" /><br/>
260
      </xsl:if>
261
      
262
      <!-- display the dataset specific field if present -->
263
      <xsl:if test="count(resource/dataset/geoForm) &gt; 0">
264
        <h3 class="highlight">Data Format:</h3>
265
        <xsl:value-of select="resource/dataset/geoForm" />
266
      </xsl:if>
267
      
268
      <xsl:if test="count(resource/*/abstract) &gt; 0">
269
        <h3 class="highlight">Abstract</h3>
270
        <xsl:value-of select="resource/*/abstract" /><br/>
271
      </xsl:if>
272
      
273
      <xsl:for-each select="resource/*/url">
274
        URL:&nbsp; 
275
        <a>
276
        <xsl:attribute name="href">
277
          <xsl:value-of select="./URL" />
278
        </xsl:attribute>
279
        <xsl:value-of select="./URL" /><br/>
280
        </a>
281
      </xsl:for-each>
282
      <br/>
283
      
284
      <xsl:if test="count(resource/*/keywordInfo) &gt; 0">
285
        <h3 class="highlight">Keywords</h3>
286
        <table width="50%" border="0">
287
        <tr class="tablehead">
288
          <th>Keyword</th><th>Keyword Type</th><th>Keyword Thesauri</th>
289
        </tr>
290
       
291
        <xsl:for-each select="resource/*/keywordInfo">
292
          <tr valign="top">
293
            <xsl:attribute name="class">
294
              <xsl:choose>
295
                <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
296
                <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
297
              </xsl:choose>
298
            </xsl:attribute>
299
            <td>
300
              <xsl:value-of select="./keyword"/>
301
            </td>
302
            <td>
303
              <xsl:value-of select="./keywordType"/>
304
            </td>
305
            <td>
306
              <xsl:for-each select="./keywordThesaurus">
307
                <xsl:value-of select="."/><br/>
308
              </xsl:for-each>
309
            </td>
310
          </tr>
311
        </xsl:for-each>
312

    
313
        </table>
314
      </xsl:if>
315
      
316
    </body>
317
    </html>
318
  </xsl:template>
319
</xsl:stylesheet>
(6-6/8)