Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *    Copyright: 2000 Regents of the University of California and the
5
  *               National Center for Ecological Analysis and Synthesis
6
  *  For Details: http://www.nceas.ucsb.edu/
7
  *
8
  *   '$Author: tao $'
9
  *     '$Date: 2003-06-18 17:10:51 -0700 (Wed, 18 Jun 2003) $'
10
  * '$Revision: 1670 $'
11
  *
12
  * This program is free software; you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License as published by
14
  * the Free Software Foundation; either version 2 of the License, or
15
  * (at your option) any later version.
16
  *
17
  * This program is distributed in the hope that it will be useful,
18
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
  * GNU General Public License for more details.
21
  *
22
  * You should have received a copy of the GNU General Public License
23
  * along with this program; if not, write to the Free Software
24
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
  *
26
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
27
  * convert an XML file that is valid with respect to the eml-variable.dtd
28
  * module of the Ecological Metadata Language (EML) into an HTML format
29
  * suitable for rendering with modern web browsers.
30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32

    
33

    
34
 <xsl:output method="html" encoding="iso-8859-1"/>
35
 
36
 <xsl:template name="method">
37
  <xsl:param name="methodfirstColStyle"/>
38
  <xsl:param name="methodsubHeaderStyle"/>
39
  <table class="tabledefault" width="100%">
40
    <xsl:for-each select="methodStep">
41
     <xsl:call-template name="methodStep">
42
        <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
43
        <xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
44
     </xsl:call-template>
45
    </xsl:for-each>
46
    <xsl:for-each select="sampling">
47
      <xsl:call-template name="sampling">
48
         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
49
         <xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
50
     </xsl:call-template>
51
    </xsl:for-each>
52
    <xsl:for-each select="qualityControl">
53
      <xsl:call-template name="qualityControl">
54
         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
55
         <xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
56
     </xsl:call-template>
57
    </xsl:for-each>
58
   </table> 
59
 </xsl:template>
60
 
61
 <!-- ******************************************
62
      Method step
63
      *******************************************-->
64
 
65
 <xsl:template name="methodStep">
66
   <xsl:param name="methodfirstColStyle"/>
67
   <xsl:param name="methodsubHeaderStyle"/>
68
   <xsl:call-template name="step">
69
     <xsl:with-param name="protocolfirstColStyle" select="$methodfirstColStyle"/>
70
     <xsl:with-param name="protocolsubHeaderStyle" select="$methodsubHeaderStyle"/>
71
   </xsl:call-template>
72
   <xsl:for-each select="dataSource">
73
       <tr><td colspan="2">
74
             <xsl:call-template name="dataset">
75
             </xsl:call-template>
76
           </td>
77
        </tr>
78
   </xsl:for-each>
79
 </xsl:template>
80
 
81
 <!-- *********************************************
82
      Sampling
83
      *********************************************-->
84
 
85
 <xsl:template name="sampling">
86
   <xsl:param name="methodfirstColStyle"/>
87
   <xsl:param name="methodsubHeaderStyle"/>
88
   <tr class="{$methodsubHeaderStyle}"><td colspan="2"><xsl:text>Sampling Info</xsl:text></td></tr>
89
   <xsl:for-each select="studyExtent">
90
      <xsl:call-template name="studyExtent">
91
         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/> 
92
      </xsl:call-template>
93
   </xsl:for-each>
94
   <xsl:for-each select="samplingDescription">
95
     <tr><td width="{$firstColWidth}" class="{$methodfirstColStyle}">
96
         Sampling Procedure
97
         </td>
98
         <td width="${secondColWidth}" class="{$secondColStyle}">
99
          &#160;
100
         </td>
101
     </tr>
102
     <tr><td colspan="2">
103
         <xsl:call-template name="text">
104
           <xsl:with-param name="textfirstColStyle" select="$methodfirstColStyle"/>
105
         </xsl:call-template>
106
         </td>
107
      </tr>
108
   </xsl:for-each>
109
   <xsl:for-each select="spatialSamplingUnits">
110
      <xsl:call-template name="studyExtent">
111
         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/> 
112
      </xsl:call-template>
113
   </xsl:for-each>
114
   <xsl:for-each select="citation">
115
      <tr><td width="{$firstColWidth}" class="{$methodfirstColStyle}">
116
         Citation
117
         </td>
118
         <td width="${secondColWidth}" class="{$secondColStyle}">
119
          &#160;
120
         </td>
121
      </tr>
122
      <tr><td colspan="2">
123
         <xsl:call-template name="citation">
124
            <xsl:with-param name="citationfirstColStyle" select="$methodfirstColStyle"/>
125
            <xsl:with-param name="citationsubHeaderStyle" select="$methodsubHeaderStyle"/>
126
         </xsl:call-template>
127
         </td>
128
      </tr>
129
   </xsl:for-each>
130
 </xsl:template>
131
 
132
 <xsl:template name="studyExtent">
133
    <xsl:param name="methodfirstColStyle"/>
134
    <xsl:param name="methodsubHeaderStyle"/>
135
    <xsl:for-each select="coverage">
136
       <tr><td colspan="2">
137
         <xsl:call-template name="coverage">
138
         </xsl:call-template>
139
         </td>
140
      </tr>
141
    </xsl:for-each>
142
    <xsl:for-each select="description">
143
      <tr><td width="{$firstColWidth}" class="{$methodfirstColStyle}">
144
         Sampling Area And Frequency
145
         </td>
146
         <td width="${secondColWidth}" class="{$secondColStyle}">
147
          &#160;
148
         </td>
149
      </tr>
150
      <tr><td colspan="2">
151
         <xsl:call-template name="text">
152
           <xsl:with-param name="textfirstColStyle" select="$methodfirstColStyle"/>
153
         </xsl:call-template>
154
         </td>
155
      </tr>
156
    </xsl:for-each>
157
 </xsl:template>
158
 
159
 <xsl:template name="spatialSamplingUnits">
160
   <xsl:param name="methodfirstColStyle"/>
161
   <xsl:for-each select="referenceEntityId">
162
      <tr><td width="{$firstColWidth}" class="{$methodfirstColStyle}">
163
         Sampling Unit Reference
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="coverage">
171
      <tr><td width="{$firstColWidth}" class="{$methodfirstColStyle}">
172
         Sampling Unit Location
173
         </td>
174
         <td width="${secondColWidth}" class="{$secondColStyle}">
175
          &#160;
176
         </td>
177
      </tr>
178
      <tr><td colspan="2">
179
         <xsl:call-template name="coverage">
180
          </xsl:call-template>
181
         </td>
182
      </tr>
183
   </xsl:for-each>
184
 </xsl:template>
185
 
186
 <!-- ***************************************
187
      quality control
188
      ***************************************-->
189
  <xsl:template name="qualityControl">
190
   <xsl:param name="methodfirstColStyle"/>
191
   <xsl:param name="methodsubHeaderStyle"/>
192
   <tr class="{$methodsubHeaderStyle}"><td colspan="2"><xsl:text>Quality Control</xsl:text></td></tr>
193
   <xsl:call-template name="step">
194
     <xsl:with-param name="protocolfirstColStyle" select="$methodfirstColStyle"/>
195
     <xsl:with-param name="protocolsubHeaderStyle" select="$methodsubHeaderStyle"/>
196
   </xsl:call-template>
197
  </xsl:template>
198
 
199
 </xsl:stylesheet>
200

    
(16-16/33)