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-07-01 15:51:44 -0700 (Tue, 01 Jul 2003) $'
11
  * '$Revision: 1711 $'
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 name="software">
38
    <xsl:param name="softwarefirstColStyle"/>
39
    <xsl:param name="softwaresubHeaderStyle"/>
40
    <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
41
        <xsl:choose>
42
         <xsl:when test="references!=''">
43
          <xsl:variable name="ref_id" select="references"/>
44
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
45
          <xsl:for-each select="$references">
46
            <xsl:call-template name="softwarecommon">
47
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
48
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
49
            </xsl:call-template>
50
          </xsl:for-each>
51
        </xsl:when>
52
        <xsl:otherwise>
53
            <xsl:call-template name="softwarecommon">
54
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
55
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
56
            </xsl:call-template>
57
        </xsl:otherwise>
58
      </xsl:choose>
59
    </table>
60
  </xsl:template>
61

    
62
  <xsl:template name="softwarecommon">
63
        <xsl:param name="softwarefirstColStyle"/>
64
        <xsl:param name="softwaresubHeaderStyle"/>
65
        <tr><td class="{$softwaresubHeaderStyle}" colspan="2">
66
        <xsl:text>Software:</xsl:text></td></tr>
67
        <xsl:call-template name="resource">
68
           <xsl:with-param name="resfirstColStyle" select="$softwarefirstColStyle"/>
69
           <xsl:with-param name="ressubHeaderStyle" select="$softwaresubHeaderStyle"/>
70
           <xsl:with-param name="creator">Author(s):</xsl:with-param>
71
        </xsl:call-template>
72
        <xsl:call-template name="implementation">
73
           <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
74
           <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
75
        </xsl:call-template>
76
         <xsl:for-each select="dependency">
77
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
78
                Dependency
79
                </td>
80
                <td width="{$secondColWidth}" class="{$secondColStyle}">
81
                 &#160;
82
                </td>
83
           </tr>
84
           <xsl:call-template name="dependency">
85
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
86
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
87
           </xsl:call-template>
88
        </xsl:for-each>
89
        <xsl:call-template name="licenseURL">
90
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
91
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
92
        </xsl:call-template>
93
        <xsl:call-template name="license">
94
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
95
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
96
        </xsl:call-template>
97
        <xsl:call-template name="version">
98
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
99
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
100
        </xsl:call-template>
101
        <xsl:call-template name="softwareAccess">
102
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
103
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
104
        </xsl:call-template>
105
        <xsl:call-template name="softwareProject">
106
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
107
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
108
        </xsl:call-template>
109
  </xsl:template>
110
  
111
  <xsl:template name="implementation">
112
     <xsl:param name="softwarefirstColStyle"/>
113
     <xsl:param name="softwaresubHeaderStyle"/>
114
     <xsl:for-each select="implementation">
115
        <tr><td colspan="2" class="{$softwaresubHeaderStyle}">
116
             Implementation Info:
117
            </td>
118
        </tr>
119
        <xsl:for-each select="distribution">
120
           <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
121
             Distribution:
122
            </td>
123
            <td width="{$secondColWidth}">
124
               <xsl:call-template name="distribution">
125
                 <xsl:with-param name="disfirstColStyle" select="$softwarefirstColStyle"/>
126
                 <xsl:with-param name="dissubHeaderStyle" select="$softwaresubHeaderStyle"/>
127
               </xsl:call-template>
128
            </td>
129
        </tr>
130
        </xsl:for-each>
131
        <xsl:for-each select="size">
132
           <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
133
             Size:
134
            </td>
135
            <td width="{$secondColWidth}" class="{$secondColStyle}">
136
             <xsl:value-of select="."/>
137
            </td>
138
        </tr>
139
        </xsl:for-each>
140
        <xsl:for-each select="language">
141
           <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
142
                Language:
143
                </td>
144
                <td width="{$secondColWidth}" class="{$secondColStyle}">
145
                  <xsl:value-of select="LanguageValue"/>
146
                </td>
147
           </tr>
148
           <xsl:if test="LanguageCodeStandard">
149
             <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
150
                Language Code Standard:
151
                </td>
152
                <td width="{$secondColWidth}" class="{$secondColStyle}">
153
                  <xsl:value-of select="LanguageValue"/>
154
                </td>
155
             </tr>
156
           </xsl:if>
157
        </xsl:for-each>
158
        <xsl:for-each select="operatingSystem">
159
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
160
                Operating System:
161
                </td>
162
                <td width="{$secondColWidth}" class="{$secondColStyle}">
163
                  <xsl:value-of select="."/>
164
                </td>
165
           </tr>
166
        </xsl:for-each>
167
        <xsl:for-each select="machineProcessor">
168
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
169
                Operating System:
170
                </td>
171
                <td width="{$secondColWidth}" class="{$secondColStyle}">
172
                  <xsl:value-of select="."/>
173
                </td>
174
           </tr>
175
        </xsl:for-each>
176
        <xsl:for-each select="virtualMachine">
177
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
178
                Virtual Machine:
179
                </td>
180
                <td width="{$secondColWidth}" class="{$secondColStyle}">
181
                  <xsl:value-of select="."/>
182
                </td>
183
           </tr>
184
        </xsl:for-each>
185
         <xsl:for-each select="diskUsage">
186
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
187
                Disk Usage:
188
                </td>
189
                <td width="{$secondColWidth}" class="{$secondColStyle}">
190
                  <xsl:value-of select="."/>
191
                </td>
192
           </tr>
193
        </xsl:for-each>
194
        <xsl:for-each select="runtimeMemoryUsage">
195
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
196
                Run Time Memory Usage:
197
                </td>
198
                <td width="{$secondColWidth}" class="{$secondColStyle}">
199
                  <xsl:value-of select="."/>
200
                </td>
201
           </tr>
202
        </xsl:for-each>
203
        <xsl:for-each select="programmingLanguage">
204
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
205
                Programming Language:
206
                </td>
207
                <td width="{$secondColWidth}" class="{$secondColStyle}">
208
                  <xsl:value-of select="."/>
209
                </td>
210
           </tr>
211
        </xsl:for-each>
212
        <xsl:for-each select="checksum">
213
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
214
                Check Sum:
215
                </td>
216
                <td width="{$secondColWidth}" class="{$secondColStyle}">
217
                  <xsl:value-of select="."/>
218
                </td>
219
           </tr>
220
        </xsl:for-each>
221
        <xsl:for-each select="dependency">
222
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
223
                Dependency:
224
                </td>
225
                <td width="{$secondColWidth}" class="{$secondColStyle}">
226
                 &#160;
227
                </td>
228
           </tr>
229
           <xsl:call-template name="dependency">
230
              <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
231
              <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
232
           </xsl:call-template>
233
        </xsl:for-each>
234
     </xsl:for-each>
235
  </xsl:template>
236
  
237
  <xsl:template name="dependency">
238
    <xsl:param name="softwarefirstColStyle"/>
239
    <xsl:param name="softwaresubHeaderStyle"/>
240
    <xsl:for-each select="../dependency">
241
      <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
242
           <b><xsl:value-of select="action"/></b> <xsl:text> Depend on</xsl:text>
243
        </td>
244
        <td width="{$secondColWidth}">
245
            <xsl:for-each select="software">
246
               <xsl:call-template name="software">
247
                  <xsl:with-param name="softwarefirstColStyle" select="$softwarefirstColStyle"/>
248
                  <xsl:with-param name="softwaresubHeaderStyle" select="$softwaresubHeaderStyle"/>
249
               </xsl:call-template>
250
            </xsl:for-each>
251
        </td>
252
      </tr>
253
    </xsl:for-each>
254
  </xsl:template>
255

    
256
  <xsl:template name="version">
257
    <xsl:param name="softwarefirstColStyle"/>
258
    <xsl:for-each select="version">
259
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
260
        Version Number:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
261
        <xsl:value-of select="."/></td></tr>
262
    </xsl:for-each>
263
  </xsl:template>
264
  
265
  <xsl:template name="licenseURL">
266
    <xsl:param name="softwarefirstColStyle"/>
267
    <xsl:for-each select="licenseURL">
268
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
269
            License URL:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
270
        <xsl:value-of select="."/></td></tr>
271
    </xsl:for-each>
272
  </xsl:template>
273
  
274
  <xsl:template name="license">
275
    <xsl:param name="softwarefirstColStyle"/>
276
    <xsl:for-each select="license">
277
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
278
            License:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
279
        <xsl:value-of select="."/></td></tr>
280
    </xsl:for-each>
281
  </xsl:template>
282
  
283
  <xsl:template name="softwareAccess">
284
    <xsl:param name="softwarefirstColStyle"/>
285
    <xsl:param name="softwaresubHeaderStyle"/>
286
    <xsl:for-each select="access">
287
      <tr><td colspan="2">
288
         <xsl:call-template name="access">
289
           <xsl:with-param name="accessfirstColStyle" select="$softwarefirstColStyle"/>
290
           <xsl:with-param name="accesssubHeaderStyle" select="$softwaresubHeaderStyle"/>
291
         </xsl:call-template>
292
         </td>
293
       </tr>
294
    </xsl:for-each>
295
  </xsl:template>
296
  
297
  <xsl:template name="softwareProject">
298
    <xsl:param name="softwarefirstColStyle"/>
299
    <xsl:param name="softwaresubHeaderStyle"/>
300
    <xsl:for-each select="project">
301
      <tr><td class="{$softwaresubHeaderStyle}" colspan="2">
302
        <xsl:text>Project Info:</xsl:text></td></tr>
303
      <tr><td colspan="2">
304
        <xsl:call-template name="project">
305
          <xsl:with-param name="projectfirstColStyle" select="$softwarefirstColStyle"/>
306
          <xsl:with-param name="projectsubHeaderStyle" select="$softwaresubHeaderStyle"/>
307
        </xsl:call-template>
308
        </td>
309
      </tr>
310
    </xsl:for-each>
311
  </xsl:template>
312
  
313
  
314
</xsl:stylesheet>
(25-25/30)