Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: 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: tao $'
10
  *     '$Date: 2003-06-20 20:19:45 -0700 (Fri, 20 Jun 2003) $'
11
  * '$Revision: 1678 $'
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-dataset.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

    
34
    
35
  <xsl:output method="html" encoding="iso-8859-1"/>
36
  
37
  <xsl:template match="dataset" mode="dataset">
38
    <table class="tabledefault" width="100%">
39
      <xsl:choose>
40
         <xsl:when test="references!=''">
41
          <xsl:variable name="ref_id" select="references"/>
42
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
43
          <xsl:for-each select="$references">
44
             <xsl:call-template name="datasetresource"/>
45
             <xsl:call-template name="datasetaccess"/>
46
             <xsl:call-template name="datasetpurpose"/>
47
             <xsl:call-template name="datasetmaintenance"/>
48
             <xsl:call-template name="datasetcontact"/>
49
             <xsl:call-template name="datasetpublisher"/>
50
             <xsl:call-template name="datasetpubplace"/>
51
             <xsl:call-template name="datasetproject"/>
52
             <xsl:call-template name="datasetentity"/>
53
          </xsl:for-each>
54
       </xsl:when>
55
       <xsl:otherwise>
56
             <xsl:call-template name="datasetresource"/>
57
             <xsl:call-template name="datasetaccess"/>
58
             <xsl:call-template name="datasetpurpose"/>
59
             <xsl:call-template name="datasetmaintenance"/>
60
             <xsl:call-template name="datasetcontact"/>
61
             <xsl:call-template name="datasetpublisher"/>
62
             <xsl:call-template name="datasetpubplace"/>
63
             <xsl:call-template name="datasetproject"/>
64
             <xsl:call-template name="datasetentity"/>
65
       </xsl:otherwise>
66
      </xsl:choose>  
67
    </table>
68
    
69
  </xsl:template>
70
  
71
  <xsl:template name="datasetresource">
72
     <tr>
73
        <td colspan="2" width="100%">
74
          <xsl:call-template name="resource">
75
            <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
76
            <xsl:with-param name="ressubHeaderStyle" select="$subHeaderStyle"/>
77
          </xsl:call-template>
78
       </td>
79
     </tr>
80
  </xsl:template>
81
  
82
 
83
  
84
  <xsl:template name="datasetpurpose">
85
    <xsl:for-each select="purpose">
86
       <tr>
87
            <td width="{$firstColWidth}" align="right" class="{$firstColStyle}">
88
            Purpose:
89
            </td>
90
            <td width="{$secondColWidth}" class="{$secondColStyle}" >
91
             &#160;
92
            </td>
93
       </tr>
94
       <tr>
95
        <td colspan="2" width="100%">
96
        <xsl:call-template name="text">
97
          <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
98
          <xsl:with-param name="textsubHeaderStyle" select="$subHeaderStyle"/>
99
        </xsl:call-template>
100
        </td>
101
      </tr>
102
    </xsl:for-each>
103
  </xsl:template>
104
  
105
  <xsl:template name="datasetmaintenance">
106
    <xsl:for-each select="maintenance">
107
      <tr><td class="{$subHeaderStyle}" colspan="2">
108
        <xsl:text>Maintenance:</xsl:text>
109
     </td></tr>
110
     <xsl:call-template name="mantenancedescription"/>
111
      <tr>
112
          <td width="{$firstColWidth}" align="right" class="{$firstColStyle}">
113
          Frequency:
114
          </td>
115
          <td width="{$secondColWidth}" class="{$secondColStyle}" >
116
           <xsl:value-of select="maintenanceUpdateFrequency"/>
117
          </td>
118
     </tr>
119
     <xsl:call-template name="changehistory"/>
120
   </xsl:for-each>
121
  </xsl:template>
122
  
123
  <xsl:template name="maintenancedescription">
124
   <xsl:for-each select="description">
125
     <tr>
126
          <td width="{$firstColWidth}" align="right" class="{$firstColStyle}">
127
          Description:
128
          </td>
129
          <td width="{$secondColWidth}" class="{$secondColStyle}" >
130
           &#160;
131
          </td>
132
     </tr>
133
     <tr>
134
        <td colspan="2" width="100%">
135
        <xsl:call-template name="text">
136
          <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
137
          <xsl:with-param name="textsubHeaderStyle" select="$subHeaderStyle"/>
138
        </xsl:call-template>
139
        </td>
140
      </tr>
141
    </xsl:for-each>
142
  </xsl:template>
143
  
144
   <xsl:template name="datasetchangehistory">
145
   <xsl:if test="changeHistory">
146
     <tr>
147
          <td width="{$firstColWidth}" align="right" class="{$firstColStyle}">
148
          History:
149
          </td>
150
          <td width="{$secondColWidth}" class="{$secondColStyle}" >
151
            <table width="100%">
152
              <xsl:for-each select="changeHistory">
153
                <xsl:call-template name="historydetails"/>
154
              </xsl:for-each>
155
            </table>
156
          </td>
157
     </tr>
158
     </xsl:if>
159
   </xsl:template>
160
   
161
   <xsl:template name="historydetails">
162
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
163
            scope:</td>
164
            <td width="{$secondColWidth}" class="{$secondColStyle}">
165
            <xsl:value-of select="changeScope"/>
166
        </td></tr>
167
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
168
            old value:</td>
169
            <td width="{$secondColWidth}" class="{$secondColStyle}">
170
            <xsl:value-of select="oldValue"/>
171
        </td></tr>
172
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
173
            change date:</td>
174
            <td width="{$secondColWidth}" class="{$secondColStyle}">
175
            <xsl:value-of select="changeDate"/>
176
        </td></tr>
177
        <xsl:if test="comment and normalize-space(comment)!=''">
178
          <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
179
            comment:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
180
            <xsl:value-of select="comment"/>
181
          </td></tr>
182
        </xsl:if>
183
  </xsl:template>
184
  
185
  <xsl:template name="datasetcontact">
186
    <tr><td class="{$subHeaderStyle}" colspan="2">
187
        <xsl:text>Contact:</xsl:text>
188
     </td></tr>
189
    <xsl:for-each select="contact">
190
     <tr><td colspan="2">
191
       <xsl:call-template name="party">
192
              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
193
       </xsl:call-template>
194
     </td></tr>
195
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">&#160;</td>
196
      <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td></tr>
197
    </xsl:for-each>
198
  </xsl:template>
199
  
200
  <xsl:template name="datasetpublisher">
201
   <xsl:for-each select="publisher">
202
     <tr><td class="{$subHeaderStyle}" colspan="2">
203
        <xsl:text>Publisher:</xsl:text>
204
     </td></tr>
205
     <tr><td colspan="2">
206
       <xsl:call-template name="party">
207
              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
208
       </xsl:call-template>
209
     </td></tr>
210
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">&#160;</td>
211
      <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td></tr>
212
   </xsl:for-each>
213
  </xsl:template>
214
  
215
  <xsl:template name="datasetpubplace">
216
    <xsl:for-each select="pubPlace">
217
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
218
           Publish Place:</td>
219
          <td width="{$secondColWidth}" class="{$secondColStyle}">
220
          <xsl:value-of select="."/>
221
          </td>
222
      </tr>
223
   </xsl:for-each>
224
  </xsl:template>
225
   
226
   <xsl:template name="datasetproject">
227
    <xsl:for-each select="project">
228
      <tr>
229
        <td colspan="2" width="100%">
230
        <xsl:call-template name="project">
231
          <xsl:with-param name="projectfirstColStyle" select="$firstColStyle"/>
232
        </xsl:call-template>
233
        </td>
234
      </tr>
235
    </xsl:for-each>
236
  </xsl:template>
237
  
238
   <xsl:template name="datasetaccess">
239
    <xsl:for-each select="access">
240
      <tr>
241
        <td colspan="2" width="100%">
242
        <xsl:call-template name="access">
243
          <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
244
          <xsl:with-param name="accesssubHeaderStyle" select="$subHeaderStyle"/>
245
        </xsl:call-template>
246
        </td>
247
      </tr>
248
    </xsl:for-each>
249
  </xsl:template>
250
  
251
  
252
  
253
  <xsl:template name="datasetentity" > 
254
   <xsl:if test="dataTable or spatialRaster or spatialVector or storedProcedures or view or otherEntity">
255
      <tr><td class="{$subHeaderStyle}" colspan="2">
256
        <xsl:text>Data Tables, Images, and Other Entities:</xsl:text>
257
     </td></tr>
258
   </xsl:if>
259
    <xsl:for-each select="dataTable">
260
      <xsl:call-template name="entityurl">
261
        <xsl:with-param name="type">dataTable</xsl:with-param>
262
        <xsl:with-param name="showtype">Data Table</xsl:with-param>
263
        <xsl:with-param name="index" select="position()"/>
264
      </xsl:call-template>
265
   </xsl:for-each>
266
   <xsl:for-each select="spatialRaster">
267
     <xsl:call-template name="entityurl">
268
        <xsl:with-param name="type">spatialRaster</xsl:with-param>
269
        <xsl:with-param name="showtype">Spatial Raster</xsl:with-param>
270
        <xsl:with-param name="index" select="position()"/>
271
      </xsl:call-template>
272
   </xsl:for-each>
273
   <xsl:for-each select="spatialVector">
274
      <xsl:call-template name="entityurl">
275
        <xsl:with-param name="type">spatialVector</xsl:with-param>
276
        <xsl:with-param name="showtype">Spatial Vector</xsl:with-param>
277
        <xsl:with-param name="index" select="position()"/>
278
      </xsl:call-template>
279
   </xsl:for-each>
280
   <xsl:for-each select="storedProcedure">
281
     <xsl:call-template name="entityurl">
282
        <xsl:with-param name="type">storedProcedure</xsl:with-param>
283
        <xsl:with-param name="showtype">Stored Procedure</xsl:with-param>
284
        <xsl:with-param name="index" select="position()"/>
285
      </xsl:call-template>
286
   </xsl:for-each>
287
   <xsl:for-each select="view">
288
      <xsl:call-template name="entityurl">
289
        <xsl:with-param name="type">view</xsl:with-param>
290
        <xsl:with-param name="showtype">View</xsl:with-param>
291
        <xsl:with-param name="index" select="position()"/>
292
      </xsl:call-template>
293
   </xsl:for-each>
294
   <xsl:for-each select="otherEntity">
295
      <xsl:call-template name="entityurl">
296
        <xsl:with-param name="type">otherEntity</xsl:with-param>
297
        <xsl:with-param name="showtype">Other Entity</xsl:with-param>
298
        <xsl:with-param name="index" select="position()"/>
299
      </xsl:call-template>
300
   </xsl:for-each>
301
  </xsl:template>
302
  
303
  <xsl:template name="entityurl">
304
     <xsl:param name="showtype"/>
305
     <xsl:param name="type"/>
306
     <xsl:param name="index"/>
307
      <xsl:choose>
308
         <xsl:when test="references!=''">
309
          <xsl:variable name="ref_id" select="references"/>
310
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
311
          <xsl:for-each select="$references">
312
            <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
313
             &#160;</td>
314
            <td width="{$secondColWidth}" class="{$firstColStyle}">
315
             <a><xsl:attribute name="href">
316
              <xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&amp;displaymodule=entity&amp;entitytype=<xsl:value-of select="$type"/>&amp;entityindex=<xsl:value-of select="$index"/></xsl:attribute>
317
             <br><xsl:value-of select="./entityName"/> (<xsl:value-of select="$showtype"/>)</br></a>
318
            </td>
319
         </tr> 
320
          </xsl:for-each>
321
        </xsl:when>
322
        <xsl:otherwise>
323
         <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
324
             &#160;</td>
325
            <td width="{$secondColWidth}" class="{$firstColStyle}">
326
             <a><xsl:attribute name="href">
327
              <xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&amp;displaymodule=entity&amp;entitytype=<xsl:value-of select="$type"/>&amp;entityindex=<xsl:value-of select="$index"/></xsl:attribute>
328
             <br><xsl:value-of select="./entityName"/> (<xsl:value-of select="$showtype"/>)</br></a>
329
            </td>
330
         </tr>
331
       </xsl:otherwise>
332
     </xsl:choose>
333
  </xsl:template>
334
  
335
  <xsl:template match="text()" mode="dataset" />
336
  <xsl:template match="text()" mode="resource" />
337

    
338
</xsl:stylesheet>
(10-10/33)