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: tao $'
10
  *     '$Date: 2003-06-16 17:22:32 -0700 (Mon, 16 Jun 2003) $'
11
  * '$Revision: 1663 $'
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

    
36
  
37

    
38
  <xsl:template name="protocol">
39
    <xsl:param name="protocolfirstColStyle"/>
40
    <xsl:param name="protocolsubHeaderStyle"/>
41
    <table class="tabledefault" width="100%">
42
        <xsl:choose>
43
         <xsl:when test="references!=''">
44
          <xsl:variable name="ref_id" select="references"/>
45
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
46
          <xsl:for-each select="$references">
47
            <xsl:call-template name="protocolCommon">
48
              <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
49
              <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
50
            </xsl:call-template>
51
          </xsl:for-each>
52
        </xsl:when>
53
        <xsl:otherwise>
54
           <xsl:call-template name="protocolCommon">
55
              <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
56
              <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
57
           </xsl:call-template>
58
        </xsl:otherwise>
59
      </xsl:choose>
60
    </table>
61
  </xsl:template>
62
  
63
   <xsl:template name="protocolcommon">
64
        <xsl:param name="protocolfirstColStyle"/>
65
        <xsl:param name="protocolsubHeaderStyle"/>
66
        <xsl:call-templates name="resource">
67
           <xsl:with-param name="resfirstColStyle" select="$protocolfirstColStyle"/>
68
           <xsl:with-param name="ressubHeaderStyle" select="$protocolsubHeaderStyle"/>
69
           <xsl:with-param name="creator">Author(s):</xsl:with-param>>
70
        </xsl:call-templates>
71
        <xsl:for-each select="proceduralStep">
72
          <tr><td colspan="2" class="{$protocolsubHeaderStyle}">
73
              <b>Step</b><xsl:text> </xsl:text><xsl:value-of select="position()"/>
74
              </td>
75
          </tr>
76
          <xsl:call-template name="step">
77
              <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
78
              <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
79
          </xsl:call-template>
80
        </xsl:for-each>
81
        <xsl:call-template name="protocolAccess">
82
              <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
83
              <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
84
        </xsl:call-template>
85
  </xsl:template>
86
  
87
  <xsl:template name="step">
88
    <xsl:param name="protocolfirstColStyle"/>
89
    <xsl:param name="protocolsubHeaderStyle"/>
90
    <xsl:for-each select="description">
91
      <tr><td width="{$firstColWidth}" class="{$protocolfirstColStyle}">
92
          Description
93
          </td>
94
          <td width="{$secondColWidth}" class="{$secondColStyle}">
95
           &#160;
96
          </td>
97
      </tr>
98
      <tr><td colspan="2">
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 width="{$firstColWidth}" class="{$protocolfirstColStyle}">
107
          Citation
108
          </td>
109
          <td width="{$secondColWidth}" 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 width="{$firstColWidth}" class="{$protocolfirstColStyle}">
123
          Protocol
124
          </td>
125
          <td width="{$secondColWidth}" class="{$secondColStyle}">
126
           &#160;
127
          </td>
128
      </tr>
129
      <tr><td colspan="2">
130
          <xsl:call-template name="protocol">
131
            <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
132
            <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
133
          </xsl:call-template>
134
          </td>
135
      </tr>
136
    </xsl:for-each>
137
    <xsl:for-each select="instrumentation">
138
        <tr><td width="{$firstColWidth}" class="{$protocolfirstColStyle}">
139
          Instrument(s)
140
          </td>
141
          <td width="{$secondColWidth}" class="{$secondColStyle}">
142
            <xsl:value-of select="."/>
143
          </td>
144
      </tr>
145
    </xsl:for-each>
146
    <xsl:for-each select="software">
147
     <tr><td colspan="2">
148
          <xsl:call-template name="software">
149
            <xsl:with-param name="softwarefirstColStyle" select="$protocolfirstColStyle"/>
150
            <xsl:with-param name="softwaresubHeaderStyle" select="$protocolsubHeaderStyle"/>
151
          </xsl:call-template>
152
          </td>
153
      </tr>
154
    </xsl:for-each>
155
    <xsl:for-each select="subStep">
156
      <tr><td width="{$firstColWidth}" class="{$protocolfirstColStyle}">
157
          Substep<xsl:text> </xsl:text><xsl:value-of select="position()"/>
158
          </td>
159
          <td width="{$secondColWidth}" class="{$secondColStyle}">
160
           &#160;
161
          </td>
162
      </tr>
163
      <xsl:call-template name="step">
164
          <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
165
          <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
166
      </xsl:call-template>
167
    </xsl:for-each>
168
  </xsl:template>
169

    
170
  <xsl:template name="protocolAccess">
171
    <xsl:param name="protocolfirstColStyle"/>
172
    <xsl:param name="protocolsubHeaderStyle"/>
173
    <xsl:for-each select="access">
174
      <tr><td colspan="2">
175
         <xsl:call-template name="access">
176
           <xsl:with-param name="accessfirstColStyle" select="protocolfirstColStyle"/>
177
           <xsl:with-param name="accesssubHeaderStyle" select="protocolsubHeaderStyle"/>
178
         </xsl:call-template>
179
         </td>
180
       </tr>
181
    </xsl:for-each>
182
  </xsl:template>
183
</xsl:stylesheet>
(21-21/33)