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-26 18:29:36 -0700 (Thu, 26 Jun 2003) $'
11
  * '$Revision: 1696 $'
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 xsl:use-attribute-sets="cellspacing" 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-template 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-template>
71
        <xsl:for-each select="proceduralStep">
72
          <tr><td colspan="2" class="{$protocolsubHeaderStyle}">
73
              Step<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
             <xsl:call-template name="text">
96
               <xsl:with-param name="textfirstColStyle" select="$protocolfirstColStyle"/>
97
             </xsl:call-template>
98
          </td>
99
      </tr>
100
     </xsl:for-each>
101
    <xsl:for-each select="citation">
102
      <tr><td width="{$firstColWidth}" class="{$protocolfirstColStyle}">
103
          Citation:
104
          </td>
105
          <td width="{$secondColWidth}" class="{$secondColStyle}">
106
           &#160;
107
          </td>
108
      </tr>
109
      <tr><td colspan="2">
110
          <xsl:call-template name="citation">
111
            <xsl:with-param name="citationfirstColStyle" select="$protocolfirstColStyle"/>
112
            <xsl:with-param name="citationsubHeaderStyle" select="$protocolsubHeaderStyle"/>
113
          </xsl:call-template>
114
          </td>
115
      </tr>
116
    </xsl:for-each>
117
     <xsl:for-each select="protocol">
118
      <tr><td width="{$firstColWidth}" class="{$protocolfirstColStyle}">
119
          Protocol:
120
          </td>
121
          <td width="{$secondColWidth}" class="{$secondColStyle}">
122
           &#160;
123
          </td>
124
      </tr>
125
      <tr><td colspan="2">
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 width="{$firstColWidth}" class="{$protocolfirstColStyle}">
135
          Instrument(s):
136
          </td>
137
          <td width="{$secondColWidth}" 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 width="{$firstColWidth}" class="{$protocolfirstColStyle}">
153
          Substep<xsl:text> </xsl:text><xsl:value-of select="position()"/>
154
          </td>
155
          <td width="{$secondColWidth}" 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
</xsl:stylesheet>
(22-22/34)