Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matthew Brooke
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-03 17:17:46 -0700 (Thu, 03 Jul 2003) $'
11
  * '$Revision: 1726 $'
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-variable.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:output method="html" encoding="iso-8859-1"/>
35

    
36
  
37
   <xsl:template name="project">
38
      <xsl:param name="projectfirstColStyle"/>
39
      <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
40
        <xsl:choose>
41
         <xsl:when test="references!=''">
42
          <xsl:variable name="ref_id" select="references"/>
43
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
44
          <xsl:for-each select="$references">
45
            <xsl:call-template name="projectcommon">
46
             <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
47
            </xsl:call-template>
48
          </xsl:for-each>
49
        </xsl:when>
50
        <xsl:otherwise>
51
          <xsl:call-template name="projectcommon">
52
             <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
53
           </xsl:call-template>
54
        </xsl:otherwise>
55
      </xsl:choose>
56
      </table>
57
  </xsl:template>
58
  
59
  
60
  
61
  <xsl:template name="projectcommon">
62
    <xsl:param name="projectfirstColStyle"/>
63
    <xsl:call-template name="projecttitle">
64
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
65
    </xsl:call-template>
66
    <xsl:call-template name="projectpersonnel">
67
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
68
    </xsl:call-template>
69
    <xsl:call-template name="projectabstract">
70
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
71
    </xsl:call-template>
72
    <xsl:call-template name="projectfunding">
73
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
74
    </xsl:call-template>
75
   <xsl:call-template name="projectstudyareadescription">
76
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
77
    </xsl:call-template>
78
    <xsl:call-template name="projectdesigndescription">
79
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
80
    </xsl:call-template>
81
    <xsl:call-template name="projectrelatedproject">
82
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
83
    </xsl:call-template>
84
  </xsl:template>
85

    
86
  
87
  
88
   <xsl:template name="projecttitle">
89
     <xsl:param name="projectfirstColStyle"/>
90
     <xsl:for-each select="title">
91
        <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
92
             Title:
93
             </td>
94
             <td width="{$secondColWidth}" class="{$secondColStyle}" >
95
              <xsl:value-of select="../title"/>
96
             </td>
97
       </tr>
98
     </xsl:for-each>
99
  </xsl:template>
100
  
101
  
102
  
103
  <xsl:template name="projectpersonnel">
104
     <xsl:param name="projectfirstColStyle"/>
105
     <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
106
          Personnel:
107
          </td>
108
          <td width="{$secondColWidth}">
109
             <table xsl:use-attribute-sets="cellspacing" width="100%">
110
                 <xsl:for-each select="personnel">
111
                       <tr><td colspan="2">
112
                              <xsl:call-template name="party">
113
                                 <xsl:with-param name="partyfirstColStyle" select="$projectfirstColStyle"/>
114
                              </xsl:call-template>
115
                       </td></tr>
116
                       <xsl:for-each select="role">
117
                          <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
118
                                 Role:
119
                               </td>
120
                               <td width="{$secondColWidth}">
121
                                 <table xsl:use-attribute-sets="cellspacing" class="tableparty" width="100%">
122
                                     <tr>
123
                                         <td width="100%" class="{$secondColStyle}">
124
                                            <xsl:value-of select="."/>
125
                                          </td>
126
                                      </tr>
127
                                  </table>
128
                               </td>
129
                          </tr>
130
                      </xsl:for-each>
131
                </xsl:for-each>
132
             </table>
133
         </td>
134
     </tr>
135
  </xsl:template>
136
  
137
  
138
   <xsl:template name="projectabstract">
139
     <xsl:param name="projectfirstColStyle"/>
140
     <xsl:for-each select="abstract">
141
       <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
142
          Abstract:
143
          </td>
144
          <td width="{$secondColWidth}">
145
             <xsl:call-template name="text">
146
                <xsl:with-param name="textfirstColStyle" select="$projectfirstColStyle"/>
147
             </xsl:call-template>
148
         </td>
149
       </tr>
150
     </xsl:for-each>
151
  </xsl:template>
152
  
153
  <xsl:template name="projectfunding">
154
     <xsl:param name="projectfirstColStyle"/>
155
     <xsl:for-each select="funding">
156
       <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
157
          Funding:
158
          </td>
159
          <td width="{$secondColWidth}">
160
              <xsl:call-template name="text">
161
                 <xsl:with-param name="textfirstColStyle" select="$projectfirstColStyle"/>
162
              </xsl:call-template>
163
         </td>
164
       </tr>
165
    </xsl:for-each>
166
  </xsl:template>
167
  
168
  
169
  
170
   <xsl:template name="projectstudyareadescription">
171
     <xsl:param name="projectfirstColStyle"/>
172
     <xsl:for-each select="studyAreaDescription">
173
       <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
174
           <xsl:text>Study Area:</xsl:text>
175
          </td>
176
          <td width="{$secondColWidth}">
177
              <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
178
                  <xsl:for-each select="descriptor">
179
                      <xsl:for-each select="descriptorValue">
180
                      <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
181
                            <xsl:value-of select="../@name"/>
182
                          </td>
183
                          <td width="{$secondColWidth}" class="{$secondColStyle}">
184
                             <xsl:choose>
185
                                <xsl:when test="./@citableClassificationSystem">
186
                                  <xsl:value-of select="."/>&#160;<xsl:value-of select="./@name_or_id"/>
187
                                </xsl:when>
188
                                <xsl:otherwise>
189
                                  <xsl:value-of select="."/>&#160;<xsl:value-of select="./@name_or_id"/>&#160;(No Citable Classification System)
190
                                </xsl:otherwise>
191
                              </xsl:choose>
192
                          </td>
193
                      </tr>
194
                      </xsl:for-each>
195
                      <xsl:for-each select="citation">
196
                        <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
197
                              Citation:
198
                            </td>
199
                            <td width="{$secondColWidth}">
200
                             <xsl:call-template name="citation"> 
201
                                  <xsl:with-param name="citationfirstColStyle" select="projectfirstColStyle"/>
202
                             </xsl:call-template>
203
                           </td>
204
                       </tr>
205
                    </xsl:for-each>
206
               </xsl:for-each>
207
            </table>
208
         </td>
209
       </tr>
210
     
211
       <xsl:for-each select="citation">
212
         <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
213
          Study Area Citation:
214
          </td>
215
          <td width="{$secondColWidth}">
216
              <xsl:call-template name="citation">
217
                   <xsl:with-param name="citationfirstColStyle" select="projectfirstColStyle"/>             
218
               </xsl:call-template>
219
          </td>
220
        </tr>
221
      </xsl:for-each>
222
       
223
       <xsl:for-each select="coverage">
224
        <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
225
          Study Area Coverage:
226
          </td>
227
          <td width="{$secondColWidth}">
228
             <xsl:call-template name="coverage"/>
229
          </td>
230
        </tr>
231
      </xsl:for-each>  
232
    </xsl:for-each>
233
   </xsl:template>
234
  
235
  
236
  
237
  <xsl:template name="projectdesigndescription">
238
    <xsl:param name="projectfirstColStyle"/>
239
    <xsl:for-each select="designDescription">
240
       <xsl:for-each select="description">
241
        <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
242
          Design Description:
243
          </td>
244
          <td width="{$secondColWidth}">
245
             <xsl:call-template name="text"/>
246
         </td>
247
       </tr>
248
      </xsl:for-each>
249
      <xsl:for-each select="citation">
250
        <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
251
          Design Citation:
252
          </td>
253
          <td width="{$secondColWidth}" >
254
             <xsl:call-template name="citation"/>
255
         </td>
256
       </tr>
257
      </xsl:for-each>
258
    </xsl:for-each>
259
  </xsl:template>
260

    
261
  
262
  
263
  <xsl:template name="projectrelatedproject">
264
    <xsl:param name="projectfirstColStyle"/>
265
    <xsl:for-each select="relatedProject">
266
       <tr><td width="{$firstColWidth}" class="{$projectfirstColStyle}">
267
          Related Project:
268
          </td>
269
          <td width="{$secondColWidth}">
270
            <xsl:call-template name="project">
271
              <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
272
            </xsl:call-template>
273
         </td>
274
       </tr>
275
    </xsl:for-each>
276
  </xsl:template>
277
 
278

    
279
</xsl:stylesheet>
(20-20/30)