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

    
325
</xsl:stylesheet>
(10-10/26)