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: leinfelder $'
10
  *     '$Date: 2013-07-15 10:37:09 -0700 (Mon, 15 Jul 2013) $'
11
  * '$Revision: 7982 $'
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

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

    
66
   <xsl:template name="protocolcommon">
67
        <xsl:param name="protocolfirstColStyle"/>
68
        <xsl:param name="protocolsubHeaderStyle"/>
69
        
70
        <!-- template for protocol shows minimum elements (author, title, dist) -->
71
		<xsl:call-template name="protocol_simple">
72
           <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
73
           <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
74
        </xsl:call-template>
75
        <xsl:for-each select="proceduralStep">
76
          <tr><td colspan="2" class="{$protocolsubHeaderStyle}">
77
              Step<xsl:text> </xsl:text><xsl:value-of select="position()"/>:
78
              </td>
79
          </tr>
80
          <xsl:call-template name="step">
81
              <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
82
              <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
83
          </xsl:call-template>
84
        </xsl:for-each>
85
        <xsl:call-template name="protocolAccess">
86
              <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
87
              <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
88
        </xsl:call-template>
89
  </xsl:template>
90

    
91
  <xsl:template name="step">
92
    <xsl:param name="protocolfirstColStyle"/>
93
    <xsl:param name="protocolsubHeaderStyle"/>
94
    <xsl:for-each select="description">
95
      <tr><td class="{$protocolfirstColStyle}">
96
          Description:
97
          </td>
98
          <td>
99
             <xsl:call-template name="text">
100
               <xsl:with-param name="textfirstColStyle" select="$protocolfirstColStyle"/>
101
             </xsl:call-template>
102
          </td>
103
      </tr>
104
     </xsl:for-each>
105
    <xsl:for-each select="citation">
106
      <tr><td class="{$protocolfirstColStyle}">
107
          Citation:
108
          </td>
109
          <td class="{$secondColStyle}">
110
           &#160;
111
          </td>
112
      </tr>
113
      <tr><td colspan="2">
114
          <xsl:call-template name="citation">
115
            <xsl:with-param name="citationfirstColStyle" select="$protocolfirstColStyle"/>
116
            <xsl:with-param name="citationsubHeaderStyle" select="$protocolsubHeaderStyle"/>
117
          </xsl:call-template>
118
          </td>
119
      </tr>
120
    </xsl:for-each>
121
     <xsl:for-each select="protocol">
122
      <tr><td class="{$protocolfirstColStyle}">
123
          Protocol:
124
          </td>
125
          <td class="{$secondColStyle}">
126
			<xsl:call-template name="protocol">
127
	            <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
128
	            <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
129
 			</xsl:call-template>
130
          </td>
131
      </tr>
132
    </xsl:for-each>
133
    <xsl:for-each select="instrumentation">
134
        <tr><td class="{$protocolfirstColStyle}">
135
          Instrument(s):
136
          </td>
137
          <td class="{$secondColStyle}">
138
            <xsl:value-of select="."/>
139
          </td>
140
      </tr>
141
    </xsl:for-each>
142
    <xsl:for-each select="software">
143
     <tr><td colspan="2">
144
          <xsl:call-template name="software">
145
            <xsl:with-param name="softwarefirstColStyle" select="$protocolfirstColStyle"/>
146
            <xsl:with-param name="softwaresubHeaderStyle" select="$protocolsubHeaderStyle"/>
147
          </xsl:call-template>
148
          </td>
149
      </tr>
150
    </xsl:for-each>
151
    <xsl:for-each select="subStep">
152
      <tr><td class="{$protocolfirstColStyle}">
153
          Substep<xsl:text> </xsl:text><xsl:value-of select="position()"/>
154
          </td>
155
          <td class="{$secondColStyle}">
156
           &#160;
157
          </td>
158
      </tr>
159
      <xsl:call-template name="step">
160
          <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
161
          <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
162
      </xsl:call-template>
163
    </xsl:for-each>
164
  </xsl:template>
165

    
166
  <xsl:template name="protocolAccess">
167
    <xsl:param name="protocolfirstColStyle"/>
168
    <xsl:param name="protocolsubHeaderStyle"/>
169
    <xsl:for-each select="access">
170
      <tr><td colspan="2">
171
         <xsl:call-template name="access">
172
           <xsl:with-param name="accessfirstColStyle" select="$protocolfirstColStyle"/>
173
           <xsl:with-param name="accesssubHeaderStyle" select="$protocolsubHeaderStyle"/>
174
         </xsl:call-template>
175
         </td>
176
       </tr>
177
    </xsl:for-each>
178
  </xsl:template>
179
  
180
  <!-- this template creates a small table for a protocol tree with minimum required 
181
	content (title/creator/distribution). Only called in this stylesheet. It would be
182
	better to reuse the resource templates? but those currently are written for 
183
	toplevel, and that style is too prominent for this location. use modes? 
184
	but all calls to resource templates would be affected.
185
	-->
186
	<xsl:template name="protocol_simple">
187
		<xsl:param name="protocolfirstColStyle"/>
188
		<xsl:param name="protocolsubHeaderStyle"/>
189
		<!--<table class="{$tabledefaultStyle}">  -->
190
		
191
		<xsl:for-each select="creator/individualName/surName">
192
			<tr>	
193
				<td class="{$protocolfirstColStyle}">
194
				<xsl:text>Author: </xsl:text>
195
				</td>
196
				<td><xsl:value-of select="."/>
197
				</td>
198
			</tr>
199
		</xsl:for-each>
200
   
201
		<xsl:for-each select="title">
202
			<tr>
203
			  <td class="{$protocolfirstColStyle}">
204
			  <xsl:text>Title: </xsl:text>
205
			  </td>
206
			  <td><xsl:value-of select="."/>
207
			  </td>
208
			</tr>
209
		</xsl:for-each>
210
 
211
	<xsl:for-each select="distribution">
212
      <!--<tr>
213
        <td>
214
         the template 'distribution' in eml-distribution.2.0.0.xsl. seems to be for
215
				data tables. use the resourcedistribution template instead (eml-resource.2.0.0.xsl)  -->
216
            <xsl:call-template name="resourcedistribution">
217
              <xsl:with-param name="resfirstColStyle" select="$protocolfirstColStyle"/>
218
              <xsl:with-param name="ressubHeaderStyle" select="$protocolsubHeaderStyle"/> 
219
			</xsl:call-template>
220
		<!-- </td>
221
		</tr>  -->
222
		</xsl:for-each>
223
		<!-- </table> -->
224
	</xsl:template>
225
	
226
</xsl:stylesheet>
(18-18/27)