Project

General

Profile

1 4824 daigle
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile: eml-method-2.0.0.xsl,v $'
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: cjones $'
9
  *     '$Date: 2004/10/05 23:50:34 $'
10
  * '$Revision: 1.1 $'
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
32
<!-- changes labeled "mob 2005-12-xx to clean up protocols. not sure of
33
impact on other elements. arghh. -->
34
35
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
36
37
  <xsl:output method="html" encoding="iso-8859-1"
38
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
39
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
40
    indent="yes" />
41
42
 <xsl:template name="method">
43
  <xsl:param name="methodfirstColStyle"/>
44
  <xsl:param name="methodsubHeaderStyle"/>
45
46
	<!-- <table class="{$tabledefaultStyle}">
47
	 use this class to unbox the table  -->
48
  <table class="subGroup onehundred_percent">
49
    <tr>
50
      <th colspan="2">
51
	<!-- changed table title. usually protocol refs, sometimes procedural steps -->
52
        <!-- Step by Step Procedures  -->
53
        Protocols and/or Procedures
54
      </th>
55
    </tr>
56
57
    <xsl:for-each select="methodStep">
58
		<!-- methodStep (defined below) calls step (defined in protocol.xsl).  -->
59
		<!-- mob added a table element to the step template so that each methodStep
60
		is boxed, but without position labels. Could add step labels back in, or just
61
		for subSteps with 'if test=substep'? proceduralStep? -->
62
		 <tr>
63
		 	<td>
64
				<xsl:call-template name="methodStep">
65
				<xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
66
				<xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
67
			 </xsl:call-template>
68
			 </td>
69
		</tr>
70
    </xsl:for-each>
71
72
    <!-- SAMPLING descr, extent -->
73
    <xsl:if test="sampling">
74
		<xsl:for-each select="sampling">
75
		<!-- <table class="{$tabledefaultStyle}">
76
			use this class to unbox the table  -->
77
			<table class="subGroup onehundred_percent">
78
          <tr>
79
				  <th colspan="2">
80
					Sampling Area and Study Extent
81
				  </th>
82
				 </tr>
83
				 <tr><td>
84
				  <xsl:call-template name="sampling">
85
						<xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
86
						<xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
87
					</xsl:call-template>
88
				</td></tr>
89
			</table>
90
		</xsl:for-each>
91
  </xsl:if>
92
93
94
95
     <!-- QUALITY CONTROL -->
96
		<!-- dont have any files to test this on yet, working? -->
97
        <xsl:if test="qualityControl">
98
            <table class="{$tabledefaultStyle}">
99
				<tr>
100
					<th colspan="2">
101
					  Quality Control
102
					</th>
103
			    </tr>
104
			<xsl:for-each select="qualityControl">
105
				<tr>
106
				  <td class="{$methodfirstColStyle}">
107
					  <b>Quality Control Step<xsl:text> </xsl:text><xsl:value-of select="position()"/>:</b>
108
				  </td>
109
				 <td width="${secondColWidth}" class="{$secondColStyle}">
110
				   &#160;
111
				 </td>
112
				</tr>
113
114
				 <xsl:call-template name="qualityControl">
115
					 <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
116
					 <xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
117
				 </xsl:call-template>
118
		    </xsl:for-each>
119
		</table>
120
		</xsl:if>
121
122
123
124
 </table>   <!-- matches table onehundredpercent, entire methodStep-->
125
 </xsl:template>
126
127
 <!-- ******************************************
128
      Method step
129
      *******************************************-->
130
131
 <xsl:template name="methodStep">
132
   <xsl:param name="methodfirstColStyle"/>
133
   <xsl:param name="methodsubHeaderStyle"/>
134
   <xsl:call-template name="step">
135
     <xsl:with-param name="protocolfirstColStyle" select="$methodfirstColStyle"/>
136
     <xsl:with-param name="protocolsubHeaderStyle" select="$methodsubHeaderStyle"/>
137
   </xsl:call-template>
138
   <xsl:for-each select="dataSource">
139
       <tr><td colspan="2">
140
             <xsl:apply-templates mode="dataset">
141
             </xsl:apply-templates>
142
           </td>
143
        </tr>
144
   </xsl:for-each>
145
 </xsl:template>
146
147
 <!-- *********************************************
148
      Sampling
149
      *********************************************-->
150
151
 <xsl:template name="sampling">
152
   <xsl:param name="methodfirstColStyle"/>
153
   <xsl:param name="methodsubHeaderStyle"/>
154
155
	   <xsl:for-each select="samplingDescription">
156
		 <table  class="{$tabledefaultStyle}">
157
     	<tr>
158
				<td class="{$methodfirstColStyle}">
159
         Sampling Description:
160
         </td>
161
         <td width="${secondColWidth}">
162
          <xsl:call-template name="text">
163
           <xsl:with-param name="textfirstColStyle" select="$methodfirstColStyle"/>
164
         </xsl:call-template>
165
         </td>
166
     </tr>
167
		 </table>
168
   </xsl:for-each>
169
170
   <xsl:for-each select="studyExtent">
171
      <xsl:call-template name="studyExtent">
172
         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
173
      </xsl:call-template>
174
   </xsl:for-each>
175
176
177
178
   <xsl:for-each select="spatialSamplingUnits">
179
      <xsl:call-template name="spatialSamplingUnits">
180
         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
181
      </xsl:call-template>
182
   </xsl:for-each>
183
184
   <xsl:for-each select="citation">
185
      <tr><td class="{$methodfirstColStyle}">
186
         Sampling Citation:
187
         </td>
188
         <td width="${secondColWidth}">
189
           <xsl:call-template name="citation">
190
            <xsl:with-param name="citationfirstColStyle" select="$methodfirstColStyle"/>
191
            <xsl:with-param name="citationsubHeaderStyle" select="$methodsubHeaderStyle"/>
192
         </xsl:call-template>
193
         </td>
194
      </tr>
195
    </xsl:for-each>
196
 </xsl:template>
197
198
 <xsl:template name="studyExtent">
199
    <xsl:param name="methodfirstColStyle"/>
200
    <xsl:param name="methodsubHeaderStyle"/>
201
    <xsl:for-each select="coverage">
202
		<!-- this table call puts each coverage node in a box -->
203
		 <table class="{$tabledefaultStyle}">
204
        <tr><td class="{$methodfirstColStyle}">
205
         Sampling Extent:
206
         </td>
207
         <td width="${secondColWidth}">
208
            <xsl:call-template name="coverage">
209
            </xsl:call-template>
210
         </td>
211
       </tr>
212
		</table>
213
    </xsl:for-each>
214
215
    <xsl:for-each select="description">
216
      <tr><td class="{$methodfirstColStyle}">
217
         Sampling Area And Frequency:
218
         </td>
219
         <td width="${secondColWidth}" >
220
           <xsl:call-template name="text">
221
              <xsl:with-param name="textfirstColStyle" select="$methodfirstColStyle"/>
222
           </xsl:call-template>
223
         </td>
224
       </tr>
225
    </xsl:for-each>
226
 </xsl:template>
227
228
 <xsl:template name="spatialSamplingUnits">
229
   <xsl:param name="methodfirstColStyle"/>
230
   <xsl:for-each select="referenceEntityId">
231
      <tr><td class="{$methodfirstColStyle}">
232
         Sampling Unit Reference:
233
         </td>
234
         <td width="${secondColWidth}" class="{$secondColStyle}">
235
          <xsl:value-of select="."/>
236
         </td>
237
      </tr>
238
   </xsl:for-each>
239
   <xsl:for-each select="coverage">
240
      <tr><td class="{$methodfirstColStyle}">
241
         Sampling Unit Location:
242
         </td>
243
         <td width="${secondColWidth}">
244
            <xsl:call-template name="coverage">
245
          </xsl:call-template>
246
         </td>
247
      </tr>
248
   </xsl:for-each>
249
 </xsl:template>
250
251
 <!-- ***************************************
252
      quality control
253
      ***************************************-->
254
  <xsl:template name="qualityControl">
255
   <xsl:param name="methodfirstColStyle"/>
256
   <xsl:param name="methodsubHeaderStyle"/>
257
   <xsl:call-template name="step">
258
     <xsl:with-param name="protocolfirstColStyle" select="$methodfirstColStyle"/>
259
     <xsl:with-param name="protocolsubHeaderStyle" select="$methodsubHeaderStyle"/>
260
   </xsl:call-template>
261
  </xsl:template>
262
263
 </xsl:stylesheet>