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: leinfelder $'
9
  *     '$Date: 2013-07-15 19:10:26 -0700 (Mon, 15 Jul 2013) $'
10
  * '$Revision: 7993 $'
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
  <xsl:output method="html" encoding="iso-8859-1"
34
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
35
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
36
    indent="yes" />  
37

    
38
 <xsl:template name="method">
39
  <xsl:param name="methodfirstColStyle"/>
40
  <xsl:param name="methodsubHeaderStyle"/>
41
  
42
    <xsl:if test="count(methodStep) > 0">
43
	    <div class="control-group">
44
	    	<label class="control-label">Methods</label>
45
	    	<div class="controls">
46
	    		<div class="accordion" id="methodAccordian">
47
				    <xsl:for-each select="methodStep">
48
				    	<div class="accordion-group">
49
					    	<div class="accordion-heading">
50
					      		<a class="accordion-toggle" data-toggle="collapse" href="#none">
51
					      			<xsl:attribute name="data-target">#methodStep<xsl:value-of select="position()"/></xsl:attribute>
52
					    			Step<xsl:text> </xsl:text><xsl:value-of select="position()"/>
53
					      		</a>
54
					    	</div>
55
					    	<div class="accordion-body collapse in">
56
					    		<xsl:attribute name="id">methodStep<xsl:value-of select="position()"/></xsl:attribute>
57
						    	<div class="accordion-inner">
58
									<xsl:call-template name="methodStep">
59
								        <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
60
								        <xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
61
									</xsl:call-template>
62
						      </div>
63
				    		</div>
64
					    </div>	
65
				    </xsl:for-each>
66
			    </div>
67
	    	</div>
68
	    </div>
69
    </xsl:if>
70
    
71
    <xsl:if test="count(sampling) > 0">
72
    	<div class="control-group">
73
	    	<label class="control-label">Sampling</label>
74
	    	<div class="controls">
75
	    		<div class="accordion" id="samplingAccordian">
76
				    <xsl:for-each select="sampling">
77
				    	<div class="accordion-group">
78
					    	<div class="accordion-heading">
79
					      		<a class="accordion-toggle" data-toggle="collapse" href="#none">
80
					      			<xsl:attribute name="data-target">#samplingStep<xsl:value-of select="position()"/></xsl:attribute>
81
					    			Sampling Step<xsl:text> </xsl:text><xsl:value-of select="position()"/>
82
					      		</a>
83
					    	</div>
84
					    	<div class="accordion-body collapse in">
85
						    		<xsl:attribute name="id">samplingStep<xsl:value-of select="position()"/></xsl:attribute>
86
							    	<div class="accordion-inner">
87
								      <xsl:call-template name="sampling">
88
								         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
89
								         <xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
90
								     </xsl:call-template>
91
								</div>
92
							</div>
93
						</div>
94
					</xsl:for-each>
95
				</div>
96
			</div>
97
		</div>
98
    </xsl:if>
99
    			
100
    <xsl:if test="count(qualityControl) > 0">
101
		<div class="control-group">
102
	    	<label class="control-label">Quality Control</label>
103
	    	<div class="controls">
104
	    		<div class="accordion" id="qualityControlAccordian">
105
				    <xsl:for-each select="qualityControl">
106
				    	<div class="accordion-group">
107
					    	<div class="accordion-heading">
108
					      		<a class="accordion-toggle" data-toggle="collapse" href="#none">
109
					      			<xsl:attribute name="data-target">#qualityControlStep<xsl:value-of select="position()"/></xsl:attribute>
110
					    			Quality Control Step<xsl:text> </xsl:text><xsl:value-of select="position()"/>
111
					      		</a>
112
					    	</div>
113
					    	<div class="accordion-body collapse in">
114
					    		<xsl:attribute name="id">qualityControlStep<xsl:value-of select="position()"/></xsl:attribute>
115
						    	<div class="accordion-inner">
116
									<xsl:call-template name="qualityControl">
117
										<xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
118
										<xsl:with-param name="methodsubHeaderStyle" select="$methodsubHeaderStyle"/>
119
									</xsl:call-template>
120
								</div>
121
							</div>		
122
						</div>	
123
				    </xsl:for-each>
124
				 </div> 
125
			 </div>
126
		 </div>  
127
	</xsl:if>
128
     
129
 </xsl:template>
130

    
131
 <!-- ******************************************
132
      Method step
133
      *******************************************-->
134

    
135
 <xsl:template name="methodStep">
136
   <xsl:param name="methodfirstColStyle"/>
137
   <xsl:param name="methodsubHeaderStyle"/>
138
   <xsl:call-template name="step">
139
     <xsl:with-param name="protocolfirstColStyle" select="$methodfirstColStyle"/>
140
     <xsl:with-param name="protocolsubHeaderStyle" select="$methodsubHeaderStyle"/>
141
   </xsl:call-template>
142
   <xsl:for-each select="dataSource">
143
       <div class="row-fluid">
144
             <xsl:apply-templates mode="dataset">
145
             </xsl:apply-templates>
146
       </div>
147
   </xsl:for-each>
148
 </xsl:template>
149

    
150
 <!-- *********************************************
151
      Sampling
152
      *********************************************-->
153

    
154
 <xsl:template name="sampling">
155
   <xsl:param name="methodfirstColStyle"/>
156
   <xsl:param name="methodsubHeaderStyle"/>
157
   <xsl:for-each select="studyExtent">
158
      <xsl:call-template name="studyExtent">
159
         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
160
      </xsl:call-template>
161
   </xsl:for-each>
162
   <xsl:for-each select="samplingDescription">
163
     <tr><td class="{$methodfirstColStyle}">
164
         Sampling Description:
165
         </td>
166
         <td width="${secondColWidth}">
167
          <xsl:call-template name="text">
168
           <xsl:with-param name="textfirstColStyle" select="$methodfirstColStyle"/>
169
         </xsl:call-template>
170
         </td>
171
     </tr>
172
   </xsl:for-each>
173
   <xsl:for-each select="spatialSamplingUnits">
174
      <xsl:call-template name="spatialSamplingUnits">
175
         <xsl:with-param name="methodfirstColStyle" select="$methodfirstColStyle"/>
176
      </xsl:call-template>
177
   </xsl:for-each>
178
   <xsl:for-each select="citation">
179
      <tr><td class="{$methodfirstColStyle}">
180
         Sampling Citation:
181
         </td>
182
         <td width="${secondColWidth}">
183
           <xsl:call-template name="citation">
184
            <xsl:with-param name="citationfirstColStyle" select="$methodfirstColStyle"/>
185
            <xsl:with-param name="citationsubHeaderStyle" select="$methodsubHeaderStyle"/>
186
         </xsl:call-template>
187
         </td>
188
      </tr>
189
    </xsl:for-each>
190
 </xsl:template>
191

    
192
 <xsl:template name="studyExtent">
193
    <xsl:param name="methodfirstColStyle"/>
194
    <xsl:param name="methodsubHeaderStyle"/>
195
    <xsl:for-each select="coverage">
196
        <tr><td class="{$methodfirstColStyle}">
197
         Sampling Coverage:
198
         </td>
199
         <td width="${secondColWidth}">
200
            <xsl:call-template name="coverage">
201
            </xsl:call-template>
202
         </td>
203
       </tr>
204
    </xsl:for-each>
205
    <xsl:for-each select="description">
206
      <tr><td class="{$methodfirstColStyle}">
207
         Sampling Area And Frequency:
208
         </td>
209
         <td width="${secondColWidth}" >
210
           <xsl:call-template name="text">
211
              <xsl:with-param name="textfirstColStyle" select="$methodfirstColStyle"/>
212
           </xsl:call-template>
213
         </td>
214
       </tr>
215
    </xsl:for-each>
216
 </xsl:template>
217

    
218
 <xsl:template name="spatialSamplingUnits">
219
   <xsl:param name="methodfirstColStyle"/>
220
   <xsl:for-each select="referenceEntityId">
221
      <tr><td class="{$methodfirstColStyle}">
222
         Sampling Unit Reference:
223
         </td>
224
         <td width="${secondColWidth}" class="{$secondColStyle}">
225
          <xsl:value-of select="."/>
226
         </td>
227
      </tr>
228
   </xsl:for-each>
229
   <xsl:for-each select="coverage">
230
      <tr><td class="{$methodfirstColStyle}">
231
         Sampling Unit Location:
232
         </td>
233
         <td width="${secondColWidth}">
234
            <xsl:call-template name="coverage">
235
          </xsl:call-template>
236
         </td>
237
      </tr>
238
   </xsl:for-each>
239
 </xsl:template>
240

    
241
 <!-- ***************************************
242
      quality control
243
      ***************************************-->
244
  <xsl:template name="qualityControl">
245
   <xsl:param name="methodfirstColStyle"/>
246
   <xsl:param name="methodsubHeaderStyle"/>
247
   <xsl:call-template name="step">
248
     <xsl:with-param name="protocolfirstColStyle" select="$methodfirstColStyle"/>
249
     <xsl:with-param name="protocolsubHeaderStyle" select="$methodsubHeaderStyle"/>
250
   </xsl:call-template>
251
  </xsl:template>
252

    
253
 </xsl:stylesheet>
254

    
(13-13/27)