Project

General

Profile

1 432 berkley
<?xml version="1.0"?>
2
<!--
3 506 jones
  * resource.xsl
4 432 berkley
  *
5 506 jones
  *      Authors: Chad Berkley, Matt Jones
6 432 berkley
  *    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$'
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 470 berkley
      <link rel="stylesheet" type="text/css"
19 497 jones
       href="@html-path@/style/rowcol.css" />
20 432 berkley
      <title>
21
        <xsl:value-of select="//title" />
22
      </title>
23
    </head>
24
    <body bgcolor="white">
25
      <h1><xsl:value-of select="//title" /></h1>
26 470 berkley
      <xsl:if test="count(//alternateTitle) &gt; 0">
27
        <h2><xsl:value-of select="//alternateTitle" /></h2>
28
      </xsl:if>
29
30 432 berkley
      <!-- 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 497 jones
      <h3 class="highlight">Contacts</h3>
51 432 berkley
52
      <xsl:for-each select="resource/*/originator">
53 497 jones
        <u>
54 432 berkley
        <xsl:value-of select="./individualName/salutation" />&nbsp;
55
        <xsl:value-of select="./individualName/givenName" />&nbsp;
56
        <xsl:value-of select="./individualName/surName" />&nbsp;
57 497 jones
        </u>
58 432 berkley
        <br />
59 497 jones
        <dir>
60
        <xsl:text>Role: </xsl:text>
61
        <xsl:value-of select="./roleCode" /><br/>
62 432 berkley
        <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 497 jones
          Phone:&nbsp;
69 432 berkley
          <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 497 jones
          Fax:&nbsp;
77 432 berkley
          <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 497 jones
          Other phone:&nbsp;
85 432 berkley
          <xsl:for-each select="./contactInfo/phone/other">
86
            <xsl:value-of select="." />
87
            &nbsp;&nbsp;
88 497 jones
            <xsl:text>Number type:</xsl:text>
89 432 berkley
            <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 500 jones
          Office hours:&nbsp;
116 432 berkley
          <xsl:value-of select="./contactInfo/hoursOfService" />
117
          <br/>
118
        </xsl:if>
119
120
        <xsl:if test="count(./contactInfo/contactInstructions) &gt; 0">
121 497 jones
          Contact instructions:&nbsp;
122 432 berkley
          <xsl:value-of select="./contactInfo/contactInstructions" />
123
          <br/>
124
        </xsl:if>
125
126 470 berkley
        <br/>
127 497 jones
        </dir>
128 432 berkley
      </xsl:for-each>
129
130 470 berkley
      <xsl:if test="count(resource/*/publisher) &gt; 0">
131 497 jones
        <h3 class="highlight">Publishing Information</h3>
132
        Publisher:
133 470 berkley
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 497 jones
          Phone:&nbsp;
146 470 berkley
          <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 497 jones
          Fax:&nbsp;
154 470 berkley
          <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 497 jones
          Other phone:&nbsp;
162 470 berkley
          <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 497 jones
          Office hours:&nbsp;
212 470 berkley
          <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 497 jones
          Contact instructions:&nbsp;
220 470 berkley
          <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 497 jones
        Publishing Date:
228 470 berkley
        &nbsp; <xsl:value-of select="resource/*/pubdate" /><br/>
229
      </xsl:if>
230
231
      <xsl:if test="count(resource/*/pubplace) &gt; 0">
232 497 jones
        Publishing Place:
233 470 berkley
        &nbsp; <xsl:value-of select="resource/*/pubplace" />
234
        <br/>
235
      </xsl:if>
236
237
      <xsl:if test="count(resource/*/series) &gt; 0">
238 497 jones
        Series:&nbsp; <xsl:value-of select="resource/*/series" /><br/>
239 470 berkley
      </xsl:if>
240
241
      <xsl:if test="count(resource/*/additionalInfo) &gt; 0">
242 497 jones
        <h3 class="highlight">Other Information</h3>
243
        Additional Information:
244 470 berkley
        &nbsp; <xsl:value-of select="resource/*/additionalInfo" /><br/>
245
      </xsl:if>
246
247 499 jones
      <!-- 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 470 berkley
      <xsl:if test="count(resource/*/abstract) &gt; 0">
254 497 jones
        <h3 class="highlight">Abstract</h3>
255
        <xsl:value-of select="resource/*/abstract" /><br/>
256 470 berkley
      </xsl:if>
257
258
      <xsl:for-each select="resource/*/url">
259 497 jones
        URL:&nbsp;
260 470 berkley
        <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 497 jones
        <h3 class="highlight">Keywords</h3>
271
        <table width="50%" border="0">
272 506 jones
        <tr class="tablehead">
273 470 berkley
          <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 497 jones
                <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
281
                <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
282 470 berkley
              </xsl:choose>
283
            </xsl:attribute>
284
            <td>
285 497 jones
              <xsl:value-of select="./keyword"/>
286 470 berkley
            </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 432 berkley
    </body>
302
    </html>
303
  </xsl:template>
304
</xsl:stylesheet>