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 470 2000-09-26 22:09:55Z berkley $'  
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@/marine/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 dataset specific field if present -->
50
      <xsl:if test="count(resource/dataset/geoForm) &gt; 0">
51
        <h2>Data Form: <xsl:value-of select="resource/dataset/geoForm" /></h2>
52
      </xsl:if>
53
      
54
      <!-- display the contact information -->
55
      <h3 class="rowlight">Contacts</h3>
56
      
57
      <xsl:for-each select="resource/*/originator">
58
        <xsl:value-of select="./individualName/salutation" />&nbsp;
59
        <xsl:value-of select="./individualName/givenName" />&nbsp;
60
        <xsl:value-of select="./individualName/surName" />&nbsp;
61
        <br />
62
        <b><xsl:value-of select="./roleCode" /></b><br/>
63
        <xsl:if test="count(resource/*/organizationName) &gt; 0">
64
          <xsl:value-of select="./organizationName" />
65
          <br />
66
        </xsl:if>
67
        
68
        <xsl:if test="count(./contactInfo/phone/voice) &gt; 0">
69
          <font class="rowodd">Voice Number(s):</font>&nbsp;
70
          <xsl:for-each select="./contactInfo/phone/voice">
71
           <xsl:value-of select="." />
72
            <br />
73
          </xsl:for-each>
74
        </xsl:if>
75
        
76
        <xsl:if test="count(./contactInfo/phone/facsimile) &gt; 0">
77
          <font class="rowodd">Fax Number(s):</font>&nbsp;
78
          <xsl:for-each select="./contactInfo/phone/facsimile">
79
            <xsl:value-of select="." />
80
            <br />
81
          </xsl:for-each>
82
        </xsl:if>
83
        
84
        <xsl:if test="count(./contactInfo/phone/other) &gt; 0">
85
          <font class="rowodd">Other Number(s):</font>&nbsp;
86
          <xsl:for-each select="./contactInfo/phone/other">
87
            <xsl:value-of select="." />
88
            &nbsp;&nbsp;
89
            <xsl:text><font class="rowodd">Number type:</font></xsl:text>
90
            <xsl:value-of select="/resource/*/*/contactInfo/phone/otherType" />
91
            <br />
92
          </xsl:for-each>
93
        </xsl:if>
94
        
95
        <xsl:if test="count(./contactInfo/address) &gt; 0">
96
          <xsl:value-of select="./contactInfo/address/deliveryPoint" /><br/>
97
          <xsl:value-of select="./contactInfo/address/city" />,&nbsp;
98
          <xsl:value-of select="./contactInfo/address/administrativeArea" />&nbsp;
99
          <xsl:value-of select="./contactInfo/address/postalCode" />&nbsp;<br/>
100
          <xsl:value-of select="./contactInfo/address/country" /><br/>
101
          <xsl:value-of select="./contactInfo/address/electronicMailAddress" />
102
          <br/>
103
        </xsl:if>
104
          
105
        <xsl:if test="count(./onlineResource) &gt; 0">
106
          <xsl:value-of select="./onlineResource/linkage/URL" /><br/>
107
          <xsl:value-of select="./onlineResource/protocol" /><br/>
108
          <xsl:value-of select="./onlineResource/applicationProtocol" /><br/>
109
          <xsl:value-of select="./onlineResource/linkage/name" /><br/>
110
          <xsl:value-of select="./onlineResource/linkage/description" /><br/>
111
          <xsl:value-of select="./onlineResource/linkage/functionCode" /><br/>
112
          <br />
113
        </xsl:if>
114
        
115
        <xsl:if test="count(./contactInfo/hoursOfService) &gt; 0">
116
          <font class="rowodd">Office hourse:</font> &nbsp;
117
          <xsl:value-of select="./contactInfo/hoursOfService" />
118
          <br/>
119
        </xsl:if>
120
        
121
        <xsl:if test="count(./contactInfo/contactInstructions) &gt; 0">
122
          <font class="rowodd">Contact instructions:</font>&nbsp;
123
          <xsl:value-of select="./contactInfo/contactInstructions" />
124
          <br/>
125
        </xsl:if>
126
        
127
        <br/>
128
      </xsl:for-each>
129
      
130
      <h3 class="rowlight">Publishing Information</h3>
131
      <xsl:if test="count(resource/*/publisher) &gt; 0">
132
        <font class="rowodd">Publisher:</font> 
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
          <font class="rowodd">Voice Number(s):</font>&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
          <font class="rowodd">Fax Number(s):</font>&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
          <font class="rowodd">Other Number(s):</font>&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
          <font class="rowodd">Office hourse:</font> &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
          <font class="rowodd">Contact instructions:</font>&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
        <font class="rowodd">Publishing Date:</font>
228
        &nbsp; <xsl:value-of select="resource/*/pubdate" /><br/>
229
      </xsl:if>
230
      
231
      <xsl:if test="count(resource/*/pubplace) &gt; 0">
232
        <font class="rowodd">Publishing Place:</font> 
233
        &nbsp; <xsl:value-of select="resource/*/pubplace" />
234
        <br/>
235
      </xsl:if>
236
      
237
      <xsl:if test="count(resource/*/series) &gt; 0">
238
        <font class="rowodd">Series:</font> &nbsp; <xsl:value-of select="resource/*/series" /><br/>
239
      </xsl:if>
240
      
241
      <h3 class="rowlight">Other Information</h3>
242
      <xsl:if test="count(resource/*/additionalInfo) &gt; 0">
243
        <font class="rowodd">Additional Information: </font>
244
        &nbsp; <xsl:value-of select="resource/*/additionalInfo" /><br/>
245
      </xsl:if>
246
      
247
      <xsl:if test="count(resource/*/abstract) &gt; 0">
248
        <font class="rowodd">Abstract:</font>
249
        &nbsp; <xsl:value-of select="resource/*/abstract" /><br/>
250
      </xsl:if>
251
      
252
      <xsl:for-each select="resource/*/url">
253
        <font class="rowodd">URL:</font> &nbsp; 
254
        <a>
255
        <xsl:attribute name="href">
256
          <xsl:value-of select="./URL" />
257
        </xsl:attribute>
258
        <xsl:value-of select="./URL" /><br/>
259
        </a>
260
      </xsl:for-each>
261
      <br/>
262
      
263
      <xsl:if test="count(resource/*/keywordInfo) &gt; 0">
264
        <h3 class="rowlight">Keywords</h3>
265
        <table width="50%" border="1">
266
        <tr class="rowodd">
267
          <th>Keyword</th><th>Keyword Type</th><th>Keyword Thesauri</th>
268
        </tr>
269
       
270
        <xsl:for-each select="resource/*/keywordInfo">
271
          <tr valign="top">
272
            <xsl:attribute name="class">
273
              <xsl:choose>
274
                <xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>
275
                <xsl:when test="position() mod 2 = 0">rowlight</xsl:when>
276
              </xsl:choose>
277
            </xsl:attribute>
278
            <td>
279
              <xsl:value-of select="./keyword"/>, &nbsp;
280
            </td>
281
            <td>
282
              <xsl:value-of select="./keywordType"/>
283
            </td>
284
            <td>
285
              <xsl:for-each select="./keywordThesaurus">
286
                <xsl:value-of select="."/><br/>
287
              </xsl:for-each>
288
            </td>
289
          </tr>
290
        </xsl:for-each>
291

    
292
        </table>
293
      </xsl:if>
294
      
295
    </body>
296
    </html>
297
  </xsl:template>
298
</xsl:stylesheet>
(4-4/6)