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: cjones $'
10
  *     '$Date: 2006-11-17 13:37:07 -0800 (Fri, 17 Nov 2006) $'
11
  * '$Revision: 3094 $'
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
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
36
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
37
              indent="yes" />  
38

    
39

    
40
   <xsl:template name="project">
41
      <xsl:param name="projectfirstColStyle"/>
42
      <table class="{$tabledefaultStyle}">
43
        <xsl:choose>
44
         <xsl:when test="references!=''">
45
          <xsl:variable name="ref_id" select="references"/>
46
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
47
          <xsl:for-each select="$references">
48
            <xsl:call-template name="projectcommon">
49
             <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
50
            </xsl:call-template>
51
          </xsl:for-each>
52
        </xsl:when>
53
        <xsl:otherwise>
54
          <xsl:call-template name="projectcommon">
55
             <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
56
           </xsl:call-template>
57
        </xsl:otherwise>
58
      </xsl:choose>
59
      </table>
60
  </xsl:template>
61

    
62

    
63

    
64
  <xsl:template name="projectcommon">
65
    <xsl:param name="projectfirstColStyle"/>
66
    <xsl:call-template name="projecttitle">
67
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
68
    </xsl:call-template>
69
    <xsl:call-template name="projectpersonnel">
70
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
71
    </xsl:call-template>
72
    <xsl:call-template name="projectabstract">
73
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
74
    </xsl:call-template>
75
    <xsl:call-template name="projectfunding">
76
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
77
    </xsl:call-template>
78
   <xsl:call-template name="projectstudyareadescription">
79
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
80
    </xsl:call-template>
81
    <xsl:call-template name="projectdesigndescription">
82
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
83
    </xsl:call-template>
84
    <xsl:call-template name="projectrelatedproject">
85
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
86
    </xsl:call-template>
87
  </xsl:template>
88

    
89

    
90

    
91
   <xsl:template name="projecttitle">
92
     <xsl:param name="projectfirstColStyle"/>
93
     <xsl:for-each select="title">
94
        <tr><td class="{$projectfirstColStyle}">
95
             Title:
96
             </td>
97
             <td class="{$secondColStyle}" >
98
              <xsl:value-of select="../title"/>
99
             </td>
100
       </tr>
101
     </xsl:for-each>
102
  </xsl:template>
103

    
104

    
105

    
106
  <xsl:template name="projectpersonnel">
107
     <xsl:param name="projectfirstColStyle"/>
108
     <tr><td class="{$projectfirstColStyle}">
109
          Personnel:
110
          </td>
111
          <td>
112
             <table>
113
                 <xsl:for-each select="personnel">
114
                       <tr><td colspan="2">
115
                              <xsl:call-template name="party">
116
                                 <xsl:with-param name="partyfirstColStyle" select="$projectfirstColStyle"/>
117
                              </xsl:call-template>
118
                       </td></tr>
119
                       <xsl:for-each select="role">
120
                          <tr><td class="{$projectfirstColStyle}">
121
                                 Role:
122
                               </td>
123
                               <td>
124
                                 <table class="{$tablepartyStyle}">
125
                                     <tr>
126
                                         <td class="{$secondColStyle}">
127
                                            <xsl:value-of select="."/>
128
                                          </td>
129
                                      </tr>
130
                                  </table>
131
                               </td>
132
                          </tr>
133
                      </xsl:for-each>
134
                </xsl:for-each>
135
             </table>
136
         </td>
137
     </tr>
138
  </xsl:template>
139

    
140

    
141
   <xsl:template name="projectabstract">
142
     <xsl:param name="projectfirstColStyle"/>
143
     <xsl:for-each select="abstract">
144
       <tr><td class="{$projectfirstColStyle}">
145
          Abstract:
146
          </td>
147
          <td>
148
             <xsl:call-template name="text">
149
                <xsl:with-param name="textfirstColStyle" select="$projectfirstColStyle"/>
150
             </xsl:call-template>
151
         </td>
152
       </tr>
153
     </xsl:for-each>
154
  </xsl:template>
155

    
156
  <xsl:template name="projectfunding">
157
     <xsl:param name="projectfirstColStyle"/>
158
     <xsl:for-each select="funding">
159
       <tr><td class="{$projectfirstColStyle}">
160
          Funding:
161
          </td>
162
          <td>
163
              <xsl:call-template name="text">
164
                 <xsl:with-param name="textfirstColStyle" select="$projectfirstColStyle"/>
165
              </xsl:call-template>
166
         </td>
167
       </tr>
168
    </xsl:for-each>
169
  </xsl:template>
170

    
171

    
172

    
173
   <xsl:template name="projectstudyareadescription">
174
     <xsl:param name="projectfirstColStyle"/>
175
     <xsl:for-each select="studyAreaDescription">
176
       <tr><td class="{$projectfirstColStyle}">
177
           <xsl:text>Study Area:</xsl:text>
178
          </td>
179
          <td>
180
              <table class="{$tabledefaultStyle}">
181
                  <xsl:for-each select="descriptor">
182
                      <xsl:for-each select="descriptorValue">
183
                      <tr><td class="{$projectfirstColStyle}">
184
                            <xsl:value-of select="../@name"/>
185
                          </td>
186
                          <td class="{$secondColStyle}">
187
                             <xsl:choose>
188
                                <xsl:when test="./@citableClassificationSystem">
189
                                  <xsl:value-of select="."/>&#160;<xsl:value-of select="./@name_or_id"/>
190
                                </xsl:when>
191
                                <xsl:otherwise>
192
                                  <xsl:value-of select="."/>&#160;<xsl:value-of select="./@name_or_id"/>&#160;(No Citable Classification System)
193
                                </xsl:otherwise>
194
                              </xsl:choose>
195
                          </td>
196
                      </tr>
197
                      </xsl:for-each>
198
                      <xsl:for-each select="citation">
199
                        <tr><td class="{$projectfirstColStyle}">
200
                              Citation:
201
                            </td>
202
                            <td>
203
                             <xsl:call-template name="citation">
204
                                  <xsl:with-param name="citationfirstColStyle" select="projectfirstColStyle"/>
205
                             </xsl:call-template>
206
                           </td>
207
                       </tr>
208
                    </xsl:for-each>
209
               </xsl:for-each>
210
            </table>
211
         </td>
212
       </tr>
213

    
214
       <xsl:for-each select="citation">
215
         <tr><td class="{$projectfirstColStyle}">
216
          Study Area Citation:
217
          </td>
218
          <td>
219
              <xsl:call-template name="citation">
220
                   <xsl:with-param name="citationfirstColStyle" select="projectfirstColStyle"/>
221
               </xsl:call-template>
222
          </td>
223
        </tr>
224
      </xsl:for-each>
225

    
226
       <xsl:for-each select="coverage">
227
        <tr><td class="{$projectfirstColStyle}">
228
          Study Area Coverage:
229
          </td>
230
          <td>
231
             <xsl:call-template name="coverage"/>
232
          </td>
233
        </tr>
234
      </xsl:for-each>
235
    </xsl:for-each>
236
   </xsl:template>
237

    
238

    
239

    
240
  <xsl:template name="projectdesigndescription">
241
    <xsl:param name="projectfirstColStyle"/>
242
    <xsl:for-each select="designDescription">
243
       <xsl:for-each select="description">
244
        <tr><td class="{$projectfirstColStyle}">
245
          Design Description:
246
          </td>
247
          <td>
248
             <xsl:call-template name="text"/>
249
         </td>
250
       </tr>
251
      </xsl:for-each>
252
      <xsl:for-each select="citation">
253
        <tr><td class="{$projectfirstColStyle}">
254
          Design Citation:
255
          </td>
256
          <td >
257
             <xsl:call-template name="citation"/>
258
         </td>
259
       </tr>
260
      </xsl:for-each>
261
    </xsl:for-each>
262
  </xsl:template>
263

    
264

    
265

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

    
281

    
282
</xsl:stylesheet>
(17-17/28)