Project

General

Profile

1 4823 daigle
<?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: cjones $'
10
  *     '$Date: 2006-11-17 13:37:07 -0800 (Fri, 17 Nov 2006) $'
11
  * '$Revision: 3094 $'
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
        <xsl:call-template name="resource">
70
           <xsl:with-param name="resfirstColStyle" select="$protocolfirstColStyle"/>
71
           <xsl:with-param name="ressubHeaderStyle" select="$protocolsubHeaderStyle"/>
72
           <xsl:with-param name="creator">Author(s):</xsl:with-param>
73
        </xsl:call-template>
74
        <xsl:for-each select="proceduralStep">
75
          <tr><td colspan="2" class="{$protocolsubHeaderStyle}">
76
              Step<xsl:text> </xsl:text><xsl:value-of select="position()"/>:
77
              </td>
78
          </tr>
79
          <xsl:call-template name="step">
80
              <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
81
              <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
82
          </xsl:call-template>
83
        </xsl:for-each>
84
        <xsl:call-template name="protocolAccess">
85
              <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
86
              <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
87
        </xsl:call-template>
88
  </xsl:template>
89
90
  <xsl:template name="step">
91
    <xsl:param name="protocolfirstColStyle"/>
92
    <xsl:param name="protocolsubHeaderStyle"/>
93
    <xsl:for-each select="description">
94
      <tr><td class="{$protocolfirstColStyle}">
95
          Description:
96
          </td>
97
          <td>
98
             <xsl:call-template name="text">
99
               <xsl:with-param name="textfirstColStyle" select="$protocolfirstColStyle"/>
100
             </xsl:call-template>
101
          </td>
102
      </tr>
103
     </xsl:for-each>
104
    <xsl:for-each select="citation">
105
      <tr><td class="{$protocolfirstColStyle}">
106
          Citation:
107
          </td>
108
          <td class="{$secondColStyle}">
109
           &#160;
110
          </td>
111
      </tr>
112
      <tr><td colspan="2">
113
          <xsl:call-template name="citation">
114
            <xsl:with-param name="citationfirstColStyle" select="$protocolfirstColStyle"/>
115
            <xsl:with-param name="citationsubHeaderStyle" select="$protocolsubHeaderStyle"/>
116
          </xsl:call-template>
117
          </td>
118
      </tr>
119
    </xsl:for-each>
120
     <xsl:for-each select="protocol">
121
      <tr><td class="{$protocolfirstColStyle}">
122
          Protocol:
123
          </td>
124
          <td class="{$secondColStyle}">
125
           &#160;
126
          </td>
127
      </tr>
128
      <tr><td colspan="2">
129
          <xsl:call-template name="protocol">
130
            <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
131
            <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
132
          </xsl:call-template>
133
          </td>
134
      </tr>
135
    </xsl:for-each>
136
    <xsl:for-each select="instrumentation">
137
        <tr><td class="{$protocolfirstColStyle}">
138
          Instrument(s):
139
          </td>
140
          <td class="{$secondColStyle}">
141
            <xsl:value-of select="."/>
142
          </td>
143
      </tr>
144
    </xsl:for-each>
145
    <xsl:for-each select="software">
146
     <tr><td colspan="2">
147
          <xsl:call-template name="software">
148
            <xsl:with-param name="softwarefirstColStyle" select="$protocolfirstColStyle"/>
149
            <xsl:with-param name="softwaresubHeaderStyle" select="$protocolsubHeaderStyle"/>
150
          </xsl:call-template>
151
          </td>
152
      </tr>
153
    </xsl:for-each>
154
    <xsl:for-each select="subStep">
155
      <tr><td class="{$protocolfirstColStyle}">
156
          Substep<xsl:text> </xsl:text><xsl:value-of select="position()"/>
157
          </td>
158
          <td class="{$secondColStyle}">
159
           &#160;
160
          </td>
161
      </tr>
162
      <xsl:call-template name="step">
163
          <xsl:with-param name="protocolfirstColStyle" select="$protocolfirstColStyle"/>
164
          <xsl:with-param name="protocolsubHeaderStyle" select="$protocolsubHeaderStyle"/>
165
      </xsl:call-template>
166
    </xsl:for-each>
167
  </xsl:template>
168
169
  <xsl:template name="protocolAccess">
170
    <xsl:param name="protocolfirstColStyle"/>
171
    <xsl:param name="protocolsubHeaderStyle"/>
172
    <xsl:for-each select="access">
173
      <tr><td colspan="2">
174
         <xsl:call-template name="access">
175
           <xsl:with-param name="accessfirstColStyle" select="$protocolfirstColStyle"/>
176
           <xsl:with-param name="accesssubHeaderStyle" select="$protocolsubHeaderStyle"/>
177
         </xsl:call-template>
178
         </td>
179
       </tr>
180
    </xsl:for-each>
181
  </xsl:template>
182
</xsl:stylesheet>