Project

General

Profile

1 3094 cjones
<?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$'
10
  *     '$Date$'
11
  * '$Revision$'
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
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
37
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
38
              indent="yes" />
39
40
  <xsl:template name="software">
41
    <xsl:param name="softwarefirstColStyle"/>
42
    <xsl:param name="softwaresubHeaderStyle"/>
43
    <table class="{$tabledefaultStyle}">
44
        <xsl:choose>
45
         <xsl:when test="references!=''">
46
          <xsl:variable name="ref_id" select="references"/>
47
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
48
          <xsl:for-each select="$references">
49
            <xsl:call-template name="softwarecommon">
50
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
51
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
52
            </xsl:call-template>
53
          </xsl:for-each>
54
        </xsl:when>
55
        <xsl:otherwise>
56
            <xsl:call-template name="softwarecommon">
57
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
58
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
59
            </xsl:call-template>
60
        </xsl:otherwise>
61
      </xsl:choose>
62
    </table>
63
  </xsl:template>
64
65
  <xsl:template name="softwarecommon">
66
        <xsl:param name="softwarefirstColStyle"/>
67
        <xsl:param name="softwaresubHeaderStyle"/>
68
        <tr><td class="{$softwaresubHeaderStyle}" colspan="2">
69
        <xsl:text>Software:</xsl:text></td></tr>
70
        <xsl:call-template name="resource">
71
           <xsl:with-param name="resfirstColStyle" select="$softwarefirstColStyle"/>
72
           <xsl:with-param name="ressubHeaderStyle" select="$softwaresubHeaderStyle"/>
73
           <xsl:with-param name="creator">Author(s):</xsl:with-param>
74
        </xsl:call-template>
75
        <xsl:call-template name="implementation">
76
           <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
77
           <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
78
        </xsl:call-template>
79
         <xsl:for-each select="dependency">
80
          <tr><td class="{$softwarefirstColStyle}">
81
                Dependency
82
                </td>
83
                <td class="{$secondColStyle}">
84
                 &#160;
85
                </td>
86
           </tr>
87
           <xsl:call-template name="dependency">
88
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
89
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
90
           </xsl:call-template>
91
        </xsl:for-each>
92
        <xsl:call-template name="licenseURL">
93
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
94
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
95
        </xsl:call-template>
96
        <xsl:call-template name="license">
97
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
98
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
99
        </xsl:call-template>
100
        <xsl:call-template name="version">
101
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
102
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
103
        </xsl:call-template>
104
        <xsl:call-template name="softwareAccess">
105
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
106
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
107
        </xsl:call-template>
108
        <xsl:call-template name="softwareProject">
109
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
110
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
111
        </xsl:call-template>
112
  </xsl:template>
113
114
  <xsl:template name="implementation">
115
     <xsl:param name="softwarefirstColStyle"/>
116
     <xsl:param name="softwaresubHeaderStyle"/>
117
     <xsl:for-each select="implementation">
118
        <tr><td colspan="2" class="{$softwaresubHeaderStyle}">
119
             Implementation Info:
120
            </td>
121
        </tr>
122
        <xsl:for-each select="distribution">
123
           <tr><td class="{$softwarefirstColStyle}">
124
             Distribution:
125
            </td>
126
            <td>
127
               <xsl:call-template name="distribution">
128
                 <xsl:with-param name="disfirstColStyle" select="$softwarefirstColStyle"/>
129
                 <xsl:with-param name="dissubHeaderStyle" select="$softwaresubHeaderStyle"/>
130
               </xsl:call-template>
131
            </td>
132
        </tr>
133
        </xsl:for-each>
134
        <xsl:for-each select="size">
135
           <tr><td class="{$softwarefirstColStyle}">
136
             Size:
137
            </td>
138
            <td class="{$secondColStyle}">
139
             <xsl:value-of select="."/>
140
            </td>
141
        </tr>
142
        </xsl:for-each>
143
        <xsl:for-each select="language">
144
           <tr><td class="{$softwarefirstColStyle}">
145
                Language:
146
                </td>
147
                <td class="{$secondColStyle}">
148
                  <xsl:value-of select="LanguageValue"/>
149
                </td>
150
           </tr>
151
           <xsl:if test="LanguageCodeStandard">
152
             <tr><td class="{$softwarefirstColStyle}">
153
                Language Code Standard:
154
                </td>
155
                <td class="{$secondColStyle}">
156
                  <xsl:value-of select="LanguageValue"/>
157
                </td>
158
             </tr>
159
           </xsl:if>
160
        </xsl:for-each>
161
        <xsl:for-each select="operatingSystem">
162
          <tr><td class="{$softwarefirstColStyle}">
163
                Operating System:
164
                </td>
165
                <td class="{$secondColStyle}">
166
                  <xsl:value-of select="."/>
167
                </td>
168
           </tr>
169
        </xsl:for-each>
170
        <xsl:for-each select="machineProcessor">
171
          <tr><td class="{$softwarefirstColStyle}">
172
                Operating System:
173
                </td>
174
                <td class="{$secondColStyle}">
175
                  <xsl:value-of select="."/>
176
                </td>
177
           </tr>
178
        </xsl:for-each>
179
        <xsl:for-each select="virtualMachine">
180
          <tr><td class="{$softwarefirstColStyle}">
181
                Virtual Machine:
182
                </td>
183
                <td class="{$secondColStyle}">
184
                  <xsl:value-of select="."/>
185
                </td>
186
           </tr>
187
        </xsl:for-each>
188
         <xsl:for-each select="diskUsage">
189
          <tr><td class="{$softwarefirstColStyle}">
190
                Disk Usage:
191
                </td>
192
                <td class="{$secondColStyle}">
193
                  <xsl:value-of select="."/>
194
                </td>
195
           </tr>
196
        </xsl:for-each>
197
        <xsl:for-each select="runtimeMemoryUsage">
198
          <tr><td class="{$softwarefirstColStyle}">
199
                Run Time Memory Usage:
200
                </td>
201
                <td class="{$secondColStyle}">
202
                  <xsl:value-of select="."/>
203
                </td>
204
           </tr>
205
        </xsl:for-each>
206
        <xsl:for-each select="programmingLanguage">
207
          <tr><td class="{$softwarefirstColStyle}">
208
                Programming Language:
209
                </td>
210
                <td class="{$secondColStyle}">
211
                  <xsl:value-of select="."/>
212
                </td>
213
           </tr>
214
        </xsl:for-each>
215
        <xsl:for-each select="checksum">
216
          <tr><td class="{$softwarefirstColStyle}">
217
                Check Sum:
218
                </td>
219
                <td class="{$secondColStyle}">
220
                  <xsl:value-of select="."/>
221
                </td>
222
           </tr>
223
        </xsl:for-each>
224
        <xsl:for-each select="dependency">
225
          <tr><td class="{$softwarefirstColStyle}">
226
                Dependency:
227
                </td>
228
                <td class="{$secondColStyle}">
229
                 &#160;
230
                </td>
231
           </tr>
232
           <xsl:call-template name="dependency">
233
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
234
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
235
           </xsl:call-template>
236
        </xsl:for-each>
237
     </xsl:for-each>
238
  </xsl:template>
239
240
  <xsl:template name="dependency">
241
    <xsl:param name="softwarefirstColStyle"/>
242
    <xsl:param name="softwaresubHeaderStyle"/>
243
    <xsl:for-each select="../dependency">
244
      <tr><td class="{$softwarefirstColStyle}">
245
           <b><xsl:value-of select="action"/></b> <xsl:text> Depend on</xsl:text>
246
        </td>
247
        <td>
248
            <xsl:for-each select="software">
249
               <xsl:call-template name="software">
250
                  <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
251
                  <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
252
               </xsl:call-template>
253
            </xsl:for-each>
254
        </td>
255
      </tr>
256
    </xsl:for-each>
257
  </xsl:template>
258
259
  <xsl:template name="version">
260
    <xsl:param name="softwarefirstColStyle"/>
261
    <xsl:for-each select="version">
262
        <tr><td class="{$firstColStyle}">
263
        Version Number:</td><td class="{$secondColStyle}">
264
        <xsl:value-of select="."/></td></tr>
265
    </xsl:for-each>
266
  </xsl:template>
267
268
  <xsl:template name="licenseURL">
269
    <xsl:param name="softwarefirstColStyle"/>
270
    <xsl:for-each select="licenseURL">
271
        <tr><td class="{$firstColStyle}">
272
            License URL:</td><td class="{$secondColStyle}">
273
        <xsl:value-of select="."/></td></tr>
274
    </xsl:for-each>
275
  </xsl:template>
276
277
  <xsl:template name="license">
278
    <xsl:param name="softwarefirstColStyle"/>
279
    <xsl:for-each select="license">
280
        <tr><td class="{$firstColStyle}">
281
            License:</td><td class="{$secondColStyle}">
282
        <xsl:value-of select="."/></td></tr>
283
    </xsl:for-each>
284
  </xsl:template>
285
286
  <xsl:template name="softwareAccess">
287
    <xsl:param name="softwarefirstColStyle"/>
288
    <xsl:param name="softwaresubHeaderStyle"/>
289
    <xsl:for-each select="access">
290
      <tr><td colspan="2">
291
         <xsl:call-template name="access">
292
           <xsl:with-param name="accessfirstColStyle" select="$softwarefirstColStyle"/>
293
           <xsl:with-param name="accesssubHeaderStyle" select="$softwaresubHeaderStyle"/>
294
         </xsl:call-template>
295
         </td>
296
       </tr>
297
    </xsl:for-each>
298
  </xsl:template>
299
300
  <xsl:template name="softwareProject">
301
    <xsl:param name="softwarefirstColStyle"/>
302
    <xsl:param name="softwaresubHeaderStyle"/>
303
    <xsl:for-each select="project">
304
      <tr><td class="{$softwaresubHeaderStyle}" colspan="2">
305
        <xsl:text>Project Info:</xsl:text></td></tr>
306
      <tr><td colspan="2">
307
        <xsl:call-template name="project">
308
          <xsl:with-param name="projectfirstColStyle" select="$softwarefirstColStyle"/>
309
          <xsl:with-param name="projectsubHeaderStyle" select="$softwaresubHeaderStyle"/>
310
        </xsl:call-template>
311
        </td>
312
      </tr>
313
    </xsl:for-each>
314
  </xsl:template>
315
316
317
</xsl:stylesheet>