Project

General

Profile

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

    
298
        </table>
299
      </xsl:if>
300
      
301
    </body>
302
    </html>
303
  </xsl:template>
304
</xsl:stylesheet>
(4-4/6)