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

    
344
</xsl:stylesheet>
(10-10/28)