Project

General

Profile

1 553 tao
<?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$'
10
  *     '$Date$'
11
  * '$Revision$'
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 1663 tao
34 553 tao
  <xsl:output method="html" encoding="iso-8859-1"/>
35
36 1663 tao
37
38
  <xsl:template name="protocol">
39
    <xsl:param name="protocolfirstColStyle"/>
40
    <xsl:param name="protocolsubHeaderStyle"/>
41 1696 tao
    <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
42 1663 tao
        <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 1702 tao
            <xsl:call-template name="protocolcommon">
48 1663 tao
              <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 1702 tao
           <xsl:call-template name="protocolcommon">
55 1663 tao
              <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 553 tao
  </xsl:template>
62 1663 tao
63
   <xsl:template name="protocolcommon">
64
        <xsl:param name="protocolfirstColStyle"/>
65
        <xsl:param name="protocolsubHeaderStyle"/>
66 1679 tao
        <xsl:call-template name="resource">
67 1663 tao
           <xsl:with-param name="resfirstColStyle" select="$protocolfirstColStyle"/>
68
           <xsl:with-param name="ressubHeaderStyle" select="$protocolsubHeaderStyle"/>
69 1679 tao
           <xsl:with-param name="creator">Author(s):</xsl:with-param>
70
        </xsl:call-template>
71 1663 tao
        <xsl:for-each select="proceduralStep">
72
          <tr><td colspan="2" class="{$protocolsubHeaderStyle}">
73 1692 tao
              Step<xsl:text> </xsl:text><xsl:value-of select="position()"/>:
74 1663 tao
              </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 553 tao
        </xsl:for-each>
81 1663 tao
        <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 553 tao
  </xsl:template>
86 1663 tao
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 1692 tao
          Description:
93 1663 tao
          </td>
94 1702 tao
          <td width="{$secondColWidth}">
95 1692 tao
             <xsl:call-template name="text">
96
               <xsl:with-param name="textfirstColStyle" select="$protocolfirstColStyle"/>
97
             </xsl:call-template>
98 1663 tao
          </td>
99
      </tr>
100 1692 tao
     </xsl:for-each>
101 1663 tao
    <xsl:for-each select="citation">
102
      <tr><td width="{$firstColWidth}" class="{$protocolfirstColStyle}">
103 1692 tao
          Citation:
104 1663 tao
          </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 1692 tao
          Protocol:
120 1663 tao
          </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 1692 tao
          Instrument(s):
136 1663 tao
          </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 553 tao
  </xsl:template>
165
166 1663 tao
  <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 1711 tao
           <xsl:with-param name="accessfirstColStyle" select="$protocolfirstColStyle"/>
173
           <xsl:with-param name="accesssubHeaderStyle" select="$protocolsubHeaderStyle"/>
174 1663 tao
         </xsl:call-template>
175
         </td>
176
       </tr>
177
    </xsl:for-each>
178 553 tao
  </xsl:template>
179
</xsl:stylesheet>