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-30 15:12:58 -0700 (Mon, 30 Jun 2003) $'
11
  * '$Revision: 1706 $'
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="softsubHeaderStyle" 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="softsubHeaderStyle" 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 width="{$firstColWidth}" class="{$softwarefirstColStyle}">
116
             <b>Implementation Info</b>
117
            </td>
118
            <td width="{$secondColWidth}" class="{$secondColStyle}">
119
            &#160;
120
            </td>
121
        </tr>
122
        <xsl:for-each select="distribution">
123
           <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
124
             <b>Distribution</b>
125
            </td>
126
            <td width="{$secondColWidth}">
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 width="{$firstColWidth}" class="{$softwarefirstColStyle}">
136
             Size
137
            </td>
138
            <td width="{$secondColWidth}" class="{$secondColStyle}">
139
             <xsl:value-of select="."/>
140
            </td>
141
        </tr>
142
        </xsl:for-each>
143
        <xsl:for-each select="language">
144
           <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
145
                Language
146
                </td>
147
                <td width="{$secondColWidth}" class="{$secondColStyle}">
148
                  <xsl:value-of select="LanguageValue"/>
149
                </td>
150
           </tr>
151
           <xsl:if test="LanguageCodeStandard">
152
             <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
153
                Language Code Standard
154
                </td>
155
                <td width="{$secondColWidth}" 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 width="{$firstColWidth}" class="{$softwarefirstColStyle}">
163
                Operating System
164
                </td>
165
                <td width="{$secondColWidth}" class="{$secondColStyle}">
166
                  <xsl:value-of select="."/>
167
                </td>
168
           </tr>
169
        </xsl:for-each>
170
        <xsl:for-each select="machineProcessor">
171
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
172
                Operating System
173
                </td>
174
                <td width="{$secondColWidth}" class="{$secondColStyle}">
175
                  <xsl:value-of select="."/>
176
                </td>
177
           </tr>
178
        </xsl:for-each>
179
        <xsl:for-each select="virtualMachine">
180
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
181
                Virtual Machine
182
                </td>
183
                <td width="{$secondColWidth}" class="{$secondColStyle}">
184
                  <xsl:value-of select="."/>
185
                </td>
186
           </tr>
187
        </xsl:for-each>
188
         <xsl:for-each select="diskUsage">
189
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
190
                diskUsage
191
                </td>
192
                <td width="{$secondColWidth}" class="{$secondColStyle}">
193
                  <xsl:value-of select="."/>
194
                </td>
195
           </tr>
196
        </xsl:for-each>
197
        <xsl:for-each select="runtimeMemoryUsage">
198
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
199
                Run Time Memory Usage
200
                </td>
201
                <td width="{$secondColWidth}" class="{$secondColStyle}">
202
                  <xsl:value-of select="."/>
203
                </td>
204
           </tr>
205
        </xsl:for-each>
206
        <xsl:for-each select="programmingLanguage">
207
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
208
                Programming Language
209
                </td>
210
                <td width="{$secondColWidth}" class="{$secondColStyle}">
211
                  <xsl:value-of select="."/>
212
                </td>
213
           </tr>
214
        </xsl:for-each>
215
        <xsl:for-each select="checksum">
216
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
217
                Check Sum
218
                </td>
219
                <td width="{$secondColWidth}" class="{$secondColStyle}">
220
                  <xsl:value-of select="."/>
221
                </td>
222
           </tr>
223
        </xsl:for-each>
224
        <xsl:for-each select="dependency">
225
          <tr><td width="{$firstColWidth}" class="{$softwarefirstColStyle}">
226
                Dependency
227
                </td>
228
                <td width="{$secondColWidth}" 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 width="{$firstColWidth}" class="{$softwarefirstColStyle}">
245
           <b><xsl:value-of select="action"/></b> <xsl:text> Depend on</xsl:text>
246
        </td>
247
        <td width="{$secondColWidth}">
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 width="{$firstColWidth}" class="{$firstColStyle}">
263
        Version Number</td><td width="{$secondColWidth}" 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 width="{$firstColWidth}" class="{$firstColStyle}">
272
            License URL</td><td width="{$secondColWidth}" 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 width="{$firstColWidth}" class="{$firstColStyle}">
281
            License</td><td width="{$secondColWidth}" 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>
(25-25/30)